Closed hakanderyal closed 8 years ago
It seems like this isn't strictly a redux-router issue. react-router is creating the router object where nested objects are always created anew, even if nothing has changed.
It seems like unnecessary work for redux-router to do selective merging within the store each time ROUTER_DID_CHANGE fires when you could just implement your own shouldComponentUpdate that runs shallowEqual on the actual params. Performance will be much better in this latter scenario.
Thanks for the explanation.
I think we should add it to the docs, if it's not going to be changed.
When using params with:
the check with shallowEqual
return false, when the current and next params are the same.
So the component always re-renders when using
shouldComponentUpdate
when it should not.