Rules
no-set-state-in-component-did-mount
Full Name in eslint-plugin-react-x
Full Name in @eslint-react/eslint-plugin
Features
🔍
Presets
core
recommended
recommended-typescript
recommended-type-checked
What it does
Disallows calling this.setState
in componentDidMount
outside of functions, such as callbacks.
Updating the state after a component mount will trigger a second render()
call and can lead to property/layout thrashing.