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

Add compilation error when mixing component lifecycle methods #34

Open
kLabz opened this issue Nov 28, 2019 · 0 comments
Open

Add compilation error when mixing component lifecycle methods #34

kLabz opened this issue Nov 28, 2019 · 0 comments

Comments

@kLabz
Copy link
Owner

kLabz commented Nov 28, 2019

React will give the following runtime error:

Warning: Unsafe legacy lifecycles will not be called for components using new component APIs.

MyComponent uses getDerivedStateFromProps() but also contains the following legacy lifecycles:
  componentWillMount

The above lifecycles should be removed. Learn more about this warning here:
https://fb.me/react-unsafe-component-lifecycles

These could (and should) be catched at compile time.

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