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

Recommend eslint:no-label for functional setState #1004

Open
tsiq-swyx opened this issue Jun 26, 2018 · 2 comments · May be fixed by #1009
Open

Recommend eslint:no-label for functional setState #1004

tsiq-swyx opened this issue Jun 26, 2018 · 2 comments · May be fixed by #1009

Comments

@tsiq-swyx
Copy link

this is a pretty common mistake when using the functional form of setState:

image

and we have no warning in React (yet) for this when it happens. easiest guard is having eslint:no-label tell you about it. Should we add a mention in the setState docs?

@alexkrolick
Copy link
Collaborator

@tsiq-swyx
Copy link
Author

yeah. i'm also trying to add a warning in react itself: facebook/react#13111

swyxio added a commit to swyxio/reactjs.org that referenced this issue Jun 27, 2018
@swyxio swyxio linked a pull request Jun 27, 2018 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants