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

React 16.x will deprecate some lifecycle functions that we use as they are unsafe #164

Open
Mehuge opened this issue Apr 4, 2018 · 0 comments

Comments

@Mehuge
Copy link

Mehuge commented Apr 4, 2018

https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html

As of React 16.3, UNSAFE_componentWillMount, UNSAFE_componentWillReceiveProps and UNSAFE_componentWillUpdate will be introduced, then in a 16.x release, the original methods will be deprecated. Then, in React 17, support for the non- UNSAFE_ prefixed versions will be dropped.

This is in preparation for React async rendering.

The above blog post goes into detail about the reasoning behind this and has several examples of when these lifecycle methods might be used and how to update those components to avoid using those methods making them safe to use with async rendering.

There are currently the following counts of references to these methods in the Camelot-Unchained project.

8 componentWillMount
33 componentWillReceiveProps
11 componentWillUpdate

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

1 participant