Skip to content

Add eslint rule to avoid updating a ref in the render method #229

Description

@michenly

Motivation

The pattern come from these two issues:
Shopify/quilt#1813
react/react#18545

TL;DR
React core team is in discussion on adding warming for this and we can stop the bleeding earlier by adding this as a lint rule.

🚫 fail lint:
mutate refs in render method.

✅ pass lint:
mutate ref in a useEffect

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions