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 is deprecated #290

Open
christopher-johnson opened this issue Oct 10, 2018 · 1 comment
Open

componentWillReceiveProps is deprecated #290

christopher-johnson opened this issue Oct 10, 2018 · 1 comment
Labels
🚀 enhancement New feature or request

Comments

@christopher-johnson
Copy link

according to the latest React docs here: https://reactjs.org/docs/react-component.html,
componentWillReceiveProps should be avoided and will be renamed in v.17.

It is used frequently in core, and AFAICT could be easily be replaced with componentDidUpdate

@stephenwf stephenwf added the 🚀 enhancement New feature or request label Oct 10, 2018
@stephenwf
Copy link
Member

Thanks @christopher-johnson, yes it should be quite easy to transition over, although the frequency of calls for componentDidUpdate will be higher, as this is also called when state updates. The other option is getDerivedStateFromProps, which would require more of a refactor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚀 enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants