jsx-eslint / eslint-plugin-react

React-specific linting rules for ESLint
MIT License
8.87k stars 2.75k forks source link

warn when using setState in constructor #2371

Open mzealey opened 4 years ago

mzealey commented 4 years ago

Obviously it could have been used by functions called from the constructor, but using setState in constructor is always an issue in react and causes a warning in debug mode.

ljharb commented 4 years ago

Seems reasonable.

jenil94 commented 4 years ago

@ljharb, I would like to give a shot at it.

ljharb commented 4 years ago

Sounds great; anything with a help wanted label, and no existing linked PR, is up for grabs.