react.dev icon indicating copy to clipboard operation
react.dev copied to clipboard

Recommend eslint:no-label for functional setState

Open tsiq-swyx opened this issue 7 years ago • 3 comments
trafficstars

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?

tsiq-swyx avatar Jun 26 '18 18:06 tsiq-swyx