Skip to content

Feature request: ban createRef in function components #2966

@danvk

Description

@danvk

Using createRef in a function component is almost always a mistake because it will create a new ref on every render. Usually you want useRef (see this discussion). Since this is such an easy mistake to make, it would be helpful to have a linter rule to flag it.

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