Is there any way, how can I store react-router state (location, params, etc.) into my appState object as observable property? I am looking for something similar to react-router-redux.
The typical way to do this is to update the store representing your navigation state in the componentWillMount hooks of the routed components. When you do this a lot it doesn't feel really "clean" in the long run. For that reason we ended up not using react-router at all, and just parse routes ourselves (using route-parser). See this blog for the ideas behind it.
Based on the same ideas mobx-router was developed recently, you might give that a spin as well! Or just stick to componentWillMount if your routing is pretty trivial
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With