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

componentWillReceiveProps -> getDerivedStateFromProps #228

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

byronanderson
Copy link

react-list uses react's componentWillReceiveProps lifecycle, which has been deprecated in favor of componentDidUpdate and getDerivedStateFromProps for compatibility with async rendering (see here).

This is my stab at upgrading to the concurrent rendering safe API, not really knowing how react-list works but understanding how the refactoring from componentWillReceiveProps to getDerivedStateFromProps typically works.

This changeset attempts to maintain a good amount of backwards compatibility by polyfilling getDerivedStateFromProps using react-lifecycles-compat. Unfortunately, react-lifecycles-compat only targets react >= 0.14.9, leaving users of react-list using React between 0.14.0 and 0.14.8 out of luck.

react-list.es6 Outdated Show resolved Hide resolved
react-list.es6 Outdated Show resolved Hide resolved
also adds polyfill for older react versions
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

Successfully merging this pull request may close these issues.

2 participants