Open yanivefraim opened 8 years ago
I'm wondering the same thing. Some insight would be really helpful. redux-router's README has a comparison sections with some caveats, but ultimately says its advisable to use react-router-redux without really explaining why.
I'm making the same evaluation right now and having the same difficulty.
I get the sense (possibly from something @gaearon wrote somewhere) that one big reason is that redux-router is not as well maintained. This twitter search is all I could find right now, though even the message from just that seems pretty clear (if unelaborated). Having the docs described in this issue will be a big help, I hope.
@yanivefraim the issue you link to actually discusses using redux-react-router, which became redux-router. There was also once redux-simple-router, which became react-router-redux.
You don’t need either, why not just use React Router directly?
(I wouldn’t suggest redux-router
at all, and you only want react-router-redux
if you want DevTools support.)
Thanks @gaearon. I'm assuming you meant react-router-redux above (since that was the link target). This conversation was quite helpful for me in piecing this together. DevTools support does seem quite useful.
I was waffling for a while because of this caveat regarding router state in mapStateToProps
(we have components deep in the tree that need to access location state). But I figure I can still use withRouter
in that context and stop worrying about it.
I was waffling for a while because of this caveat regarding router state in mapStateToProps (we have components deep in the tree that need to access location state). But I figure I can still use withRouter in that context and stop worrying about it.
Exactly.
Thanks for the insights!
@gaearon - I would like to cease the opportunity and ask a (somehow related) question about Redux/React/Router. I already asked it here but did not get a proper answer...
In short: It seems really strange to me that Redux state persists across page navigations (even that we are talking about single page application, I don't really see the difference). I think the while navigating to a url application state must be clean. And I can show several examples about problems with keeping state between navigations:
a.html/page1/bla
in his browser), is it reasonable that he would get a different results then a user navigating to same address from a different page (because he has different state...)I would really love to hear your opinion about this. Thanks! Yaniv
It would be really interesting if you can tell about the decision of using Redux Router over React Router Redux.
I saw that you had an issue for using React Router Redux, and finally you chose the Redux Router.
Can you share your knowledge about this? 10x!