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

Remove usage of unsafe lifecycle hooks (React 16.3) #553

Closed
saadq opened this issue Apr 3, 2018 · 7 comments
Closed

Remove usage of unsafe lifecycle hooks (React 16.3) #553

saadq opened this issue Apr 3, 2018 · 7 comments
Labels

Comments

@saadq
Copy link
Contributor

saadq commented Apr 3, 2018

Bug, Feature, or Question?

Feature?

Current Behavior

Using Formik with React 16.3 with the <React.StrictMode></React.StrictMode> component will trigger some warnings.

Desired Behavior

Different lifecycle hooks should be used.

Suggested Solutions

The warning message states:

Warning: Unsafe lifecycle methods were found within a strict-mode tree:

componentWillMount: Please update the following components to use componentDidMount instead: Field, Formik
componentWillReceiveProps: Please update the following components to use static getDerivedStateFromProps instead: Formik

The React team also made react-lifecycles-compat which should allow for backwards compatibility when using the new lifecycle hooks.

Additional Information

More details are in the recent React blog post.

@jaredpalmer
Copy link
Owner

There is a large rewrite required for 16.3. But the great news is that it will make Formik MUCH smaller, simplify tooling (microbundle), and no longer have prop-types as a peer dep.

@mikelax
Copy link

mikelax commented Apr 5, 2018

@jaredpalmer is the large rewrite you are talking about here PR #423 ?
We are happily using formik in a couple of projects, and would like to put a plan to get them moved to 16.3, but we want that to be coordinated with the new release of formik.

Where should we "track progress", on that PR, or elsewhere?
Let us know if there is any help needed once you have an RC, etc.

@saadq saadq changed the title Remove usage of unsafe lifecycle hooks Remove usage of unsafe lifecycle hooks (React 16.3) Apr 5, 2018
@jaredpalmer
Copy link
Owner

Yes that was my first attempt. Just need time to finish it up.

@stale
Copy link

stale bot commented Aug 15, 2018

Hola! So here's the deal, between open source and my day job and life and what not, I have a lot to manage, so I use a GitHub bot to automate a few things here and there. This particular GitHub bot is going to mark this as stale because it has not had recent activity for a while. It will be closed if no further activity occurs in a few days. Do not take this personally--seriously--this is a completely automated action. If this is a mistake, just make a comment, DM me, send a carrier pidgeon, or a smoke signal.

@stale stale bot added the stale label Aug 15, 2018
@colinrobertbrooks
Copy link

📌

@stale stale bot removed the stale label Aug 15, 2018
@stale
Copy link

stale bot commented Oct 14, 2018

Hola! So here's the deal, between open source and my day job and life and what not, I have a lot to manage, so I use a GitHub bot to automate a few things here and there. This particular GitHub bot is going to mark this as stale because it has not had recent activity for a while. It will be closed if no further activity occurs in a few days. Do not take this personally--seriously--this is a completely automated action. If this is a mistake, just make a comment, DM me, send a carrier pidgeon, or a smoke signal.

@stale stale bot added the stale label Oct 14, 2018
@saadq
Copy link
Contributor Author

saadq commented Oct 18, 2018

📌

@stale stale bot removed the stale label Oct 18, 2018
@prichodko prichodko added the v2 label Oct 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants