I'm witnessing a behavior I fail to understand and that does not seems right.
When I dispatch an action, my components re-render because this.props.location
(and others, like params or routeParams) changes, and when I say "changes", I mean the pointer is different, but the inner properties are the same.
The dispatched action does not change the route in any way, just some data in the redux store (on it's own mounted key).
Consequently, shouldComponentUpdate
(not overridden) detects a change and forces a re-rendering. But there is no change at all!
That's annoying because I have a setInterval routine that dispatches an action to call the server every 30 seconds to fetch some data. And yet, connected components that does not care about this state change are still re-rendered. The redux panel shows that only this action is dispatched, no LOCATION_CHANGE.
If I unplug react-router-redux (removing the use of syncHistoryWithStore
), this behavior stops.
Is this an expected behavior, or did I miss something? I'd like not to have to override shouldComponentUpdate
in all of my connected components.
Could you point me where the react router props are being injected in the components?