Rules
no-component-will-mount
Full Name in eslint-plugin-react-x
Full Name in @eslint-react/eslint-plugin
Features
🔄
Presets
xrecommendedrecommended-typescriptrecommended-type-checked
Description
Replaces usages of componentWillMount with UNSAFE_componentWillMount.
This API has been renamed from componentWillMount to UNSAFE_componentWillMount. The old name has been deprecated. In a future major version of React, only the new name will work.
Examples
Before
After
Implementation
Further Reading
See Also
- no-component-will-receive-props
Replace usages ofcomponentWillReceivePropswithUNSAFE_componentWillReceiveProps. - no-component-will-update
Replace usages ofcomponentWillUpdatewithUNSAFE_componentWillUpdate.