DEV Community

Nipuna Weerasekara
Nipuna Weerasekara

Posted on

React 17.0 is going to be awesome...

Everyone know that in React 17 most of the depracated since 16.3 update and now they want us to rename the old lifecycles as UNSAFE_ and only they will work in 17.x React update. Now as a developer and more comfortable with these deprecated lifecycle methods, I am struggling to migrate the existing componentWillMount, componentWillReceiveProps, componentWillUpdate code to static getDerivedStateFromProps and componentDidUpdate. It would be awesome, if someone from this DEV community to provide us some guidelines to how to migrate with some examples. For an instance, if someone can provide us an example of how to migrate user profile edit which is coded using componentWillReceiveProps to newer lifecycle methods, that would be a great help.
Thanks in advance...

Top comments (2)

Collapse
 
imakecodes profile image
Michel Wilhelm

I'm interested on this topic too. I don't know how to migrate. Today I'm using componentDidMount to do async requests to populate specific components

Collapse
 
niweera profile image
Nipuna Weerasekara

I'm still using the old methods. If I get to know any source I'll let you know.