I have cloned the mobx-react-boilerplate and added react-router component. The new repo is mobx-react-router-boilerplate.
There are two components (BlueCounter, RedCounter) linked as two routes, showing the count value from the appState. The two components represent two pages. I have used the Provider from mobx-react
I am facing an issue when declaring AppState as a class and creating an instance of it, the blueCounter does not react to the actions and changes, It only show the updated value after transitioning to the RedCoutner and back to the blue one.
On the other hand, if I used the observable({}) way (which is shown in AppState2), components reaction works fine and they get updated, am I missing something in the code ?
@yasirhantoush, you should place transform-class-properties after transform-decorators-legacy in your .babelrc
Thanks @andykog , it is working perfectly now, I will update my repo, and close this ticket
Thanks again for the help.
Most helpful comment
@yasirhantoush, you should place
transform-class-propertiesaftertransform-decorators-legacyin your .babelrc