Migrate to using `getDerivedStateFromProps`
Closed this issue · 1 comments
pradeepnschrodinger commented
Let's use getDerivedStateFromProps
instead of relying on componentDidUpdate
which is more often used to dispatch side effects.
This should also help us avoid extra renders, and avoid relying on reference checks to skip renders.
getDerivedStateFromProps
is introduced from V16.3 onwards. So we'll either need to deprecate all versions under this, or apply a polyfill (something like react-lifecycles-compat
).
Extra Information:
Spun off from: #509 (comment)
Related issue: bvaughn/react-virtualized#1008
pradeepnschrodinger commented