final-form / react-final-form

🏁 High performance subscription-based form state management for React
https://final-form.org/react
MIT License
7.38k stars 480 forks source link

Replace legacy life-cycle method to fit React 17 and after version #323

Open LiangRenDev opened 6 years ago

LiangRenDev commented 6 years ago

feature request

Have you considered rewriting the code and replace the legacy life-cycle method such as componentWillMount, componentWillUpdate?

What is the current behavior?

Now I could see there are a lot of use of those functions but as mentioned by React

UNSAFE_componentWillMount() is invoked just before mounting occurs. It is called before render(), therefore calling setState() synchronously in this method will not trigger an extra rendering. Generally, we recommend using the constructor() instead for initializing state.

Avoid introducing any side-effects or subscriptions in this method. For those use cases, use componentDidMount() instead.

This is the only lifecycle hook called on server rendering.

Note

This lifecycle was previously named componentWillMount. That name will continue to work until version 17. Use the rename-unsafe-lifecycles codemod to automatically update your components.

myapos commented 5 years ago

Hello, is there any update for the above?

Thank you.

tstirrat15 commented 4 years ago

Looks like it's been resolved.