Skip to content

Add no-unsafe rule #1830

@sergei-startsev

Description

@sergei-startsev

Certain legacy lifecycle methods are unsafe for use in async React applications and cause warnings in strict mode:

  • UNSAFE_componentWillMount
  • UNSAFE_componentWillReceiveProps
  • UNSAFE_componentWillUpdate.

These also happen to be the lifecycles that cause the most confusion within the React community. At the same time there're no deprecation warnings regarding using UNSAFE_ methods and it will still be possible to use them in React 17.

The rule prevents usage of of UNSAFE_ lifecycle methods. See discussion details #1750 (comment).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions