Closed optimatex closed 6 years ago
Hello,
You don't have home
route in your routes, have you tried to change the defaultRoute?
@LeonardoGentile I have provided concise routes array, in my current code there is the home route. I have tried to tweak this parameter but it doesn't help me
Ok, but did you start your router? Do you actually navigate from one route to another as described in router5 docs?
In case you couldn't solve it, please provide a code sample so that I might be able to help you
Also, is there any piece of code observing the @observable
variables exposed by the store? Try with a console log inside a mobx autorun
@LeonardoGentile thanks for the help. I put all my relevant code here https://codesandbox.io/s/jlxopz1lk5
As I suspected you don't start your router, please do something like this:
// Renders the entire app when the router starts
router.start((err, state) => {
render(<ObserverApp />, document.getElementById("root"));
});
The react app should start after the router is started. Btw if you are using this with react I suggest you to pair this with my other package: react-mobx-router5
oh, sorry. I suppose I did miss this in docs, however, I read almost all pages from here http://router5.github.io/docs. Maybe it can be usefull to others to emphasize this part. Anyway, thanks for resolving my issue. And for the cool lib. I'll try react-mobx-router5 too
No problem, cheers!
Hi. I have followed all examples, provided in docs, but my router appears with null state. Here is my implementation:
as the results, my router store contains null in
route
props