Reputation: 1027
I am now using fluxible with react-router, I want to perform action and then redirect after the callback.
In the action, the action context has no router and fail to change the route after the action.
I have tried to find example but I can only found using browserHistory.
I can now push the browserHistory but somehow I can't find the current path. (because my new path is the depends on the current path /:id/profile, and then I want to redirect to /:id/details/:version), So I need to get back /:id/details before I append the version).
How to find the current route in the action where I can only access the action context without router instance?
Sometimes my react router works on server side but not client side. It will show when I refresh the page but 404 when in client side only.( I guess because I am using the relative link)
Does react router support relative link in the ?
Thanks
Upvotes: 1
Views: 1018
Reputation: 1027
For the Question 3, I have figured out the method to access the params
In fact, the second argument in the stateless component is context. I have pass the params and obtain there.
e.g
const CompanyDetail = (props, context) => {
}
CompanyDetail.contextTypes = {
params: PropTypes.object,
};
Upvotes: 0