Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to using getDerivedStateFromProps #512

Closed
pradeepnschrodinger opened this issue Feb 19, 2020 · 1 comment
Closed

Migrate to using getDerivedStateFromProps #512

pradeepnschrodinger opened this issue Feb 19, 2020 · 1 comment
Milestone

Comments

@pradeepnschrodinger
Copy link
Collaborator

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
Copy link
Collaborator Author

Fixed on v1.2.6 through #509 and #612.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants