Closed nareshbhatia closed 6 years ago
I am able to reproduce the issue with mobx-router-example. Simply upgrade the mobx versions to:
"mobx": "^3.4.1",
"mobx-react": "^4.3.5",
Now the UserProfile view stops responding to tab changes!
I suspect that this line of code is not triggering a reaction for some reason:
this.params = toJS(paramsObj);
Maybe it is the breaking change introduced in mobx 2.6.0. Is anyone else experiencing this?
Submitted PR #54 to address this issue.
PR merged - closing issue.
I enter the following path in the browser:
Everything works, the summary tab is rendered. Now I click on the detail tab. The path changes to:
Nothing changes in the view! The render method is not triggered even though I am dereferencing
router.params
. Here's my code (simplified):Here's the corresponding route:
I can see
onEnter
andonParamsChange
being triggered in my route, however that should not matter. The change in tabs should not retrigger a fetch - all I need is to change the view. However puzzled why the view is not reacting to a change inrouter.params
. I confirmed that it is a MobX@observer
. What am I doing wrong?Thanks in advance.