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 eslint rule to avoid updating a ref in the render method #229

Open
michenly opened this issue Apr 8, 2021 · 0 comments
Open

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

michenly opened this issue Apr 8, 2021 · 0 comments

Comments

@michenly
Copy link
Contributor

michenly commented Apr 8, 2021

Motivation

The pattern come from these two issues:
Shopify/quilt#1813
facebook/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

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

No branches or pull requests

1 participant