Closed reflog closed 6 years ago
You can use withRouter
. Did you get any errors?
no errors, just curious if the injected router will be the correct one (from routes.js) and the the default one
It works. The only caveat is it won't rerender on when you have a dynamic route and the dynamic part changes. You have to use Router events for that. (Or at least I have that problem, but maybe I'm doing something wrong)
gotcha. thanks!
There is problem
I cannot use this.props.router.push
, it reload the browser instead of keeping single page navigation.
Same with me @haotangio
@haotangio @guiihlopes, try router.pushRoute instead of router.push
...and if not, how should I inject the router into current component? (for example to access current path)