if we have the next tree of components:
<ComponentWithShouldComponentUpdate>
<ComponentWithRouter />
</ComponentWithShouldComponentUpdate>
where ComponentWithShouldComponentUpdate has shouldComponentUpdate which in some cases returns false then ComponentWithRouter doesn't update its context and so ComponentWithRouter has stale router prop :( .
just render the tree described above
router prop should be up to date.
no screenshots provided
no additional context
any news?
It would break compatibility with React version < 16.3. We can enhance current implementation by listening to Router events and forceUpdate subscribed components similar to what react-redux connect does.
I can implement it. I just need to know which events should force update of the subscribed component and how what cases do I need to test to ensure that it will not break anything.
Here's the list of Router events:
I don't think we should spend time on enhancing the current implementation, we should switch to React 16.3 Context for the next major release.
Closing in favor of #5716
Most helpful comment
I don't think we should spend time on enhancing the current implementation, we should switch to React 16.3 Context for the next major release.