Skip to content

Add compilation error when mixing component lifecycle methods #34

Description

@kLabz

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions