Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Data: Avoid responding to `componentDidUpdate` in `withDispatch` #11866
Related (alternative to): #11870
Note: The changes are less overwhelming to view when ignoring whitespace changes.
This pull request seeks to explore an optimization to
Technically this is very much broken in the current implementation of the component anyways, as the proxy props are only reassigned after the component updates. Thus, the underlying component would not receive the changed prop keys from the new
The main advantage here is that
In a separate approach, I may consider to see how to respect changing incoming props while limiting one or both of (a) calls to
Ensure tests pass:
referenced this pull request
Nov 14, 2018
This and #11870 could be considered competing approaches. Do you have any preference one way or another? I think this branch is a bigger performance win, but comes at the expense of some developer ergonomics (inability to conditionally return different keys from
Going to go with this one. It's a bit more unintuitive in the chance a developer wants to return a separate set of props, but given that the behavior has been largely broken anyways since introduced, and we had no occurrences of it in our code, and it's forward-compatible to reintroduce support, and above all the significant performance win, I think it's a worthwhile compromise.