-
-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proposal: react-router-mobx #4785
Comments
There is also some good discussion over in the Redux Integration (#4668) PR which may be relevant. |
As far as I can tell, the primary goal of react-router-redux is not to work around the blocked updates issue, but to integrate react-router with redux by syncing the router location with the redux store. I don't know mobx enough to say if that's possible/practical there, too. But if you're just concerned about the blocked updates, you don't really need an extra library for this; you can simply compose the HoCs/decorators yourself: // observerWithRouteProps.js
import {observer} from 'mobx-react';
import {withRouter} from 'react-router';
export default Component => withRouter(observer(Component)); And then just use that function instead of |
react-router-redux does nothing with If you mean the changes on react-redux, that is a separate thing were doing here: reduxjs/react-redux#625 Anything that gets around blocked updates is either something to be solved by the library that's blocking, or is something we would solve in a much more generic implementation than just for MobX's use. |
@timdorr Thanks for the info! |
During an attempted upgrade to react-router v4 in a MobX codebase, I encountered the blocked updates issue. Obviously this is a bit of a deal breaker, since it would mean wide-sweeping changes to make all of the observers aware of location changes.
I have seen it hinted at in a couple of places that react-router-redux has a way around this in v5. I think it would be beneficial if this same fix/methodology could be brought to those of us using MobX.
I can see about getting a PR ready once react-router-redux v5 gets closer to release, but I just wanted to get this idea out there.
I think having first-class MobX support like we have for Redux would go a long way in bringing the community together around the coolest router 😎
The text was updated successfully, but these errors were encountered: