Rules
no-unsafe-component-will-receive-props
Warns about the use of `UNSAFE_componentWillReceiveProps` in class components.
Full Name in eslint-plugin-react-x
react-x/no-unsafe-component-will-receive-propsFull Name in @eslint-react/eslint-plugin
@eslint-react/no-unsafe-component-will-receive-propsPresets
x
recommended
recommended-typescript
recommended-type-checked
strict
strict-typescript
strict-type-checked
Rule Details
Using unsafe lifecycle methods like UNSAFE_componentWillReceiveProps makes your component's behavior less predictable and more likely to cause bugs.
Common Violations
Invalid
import React from "react";
class MyComponent extends React.Component {
UNSAFE_componentWillReceiveProps() {
// ...
}
}Resources
Further Reading
See Also
react-x/no-unsafe-component-will-mount
Warns about the use ofUNSAFE_componentWillMountin class components.react-x/no-unsafe-component-will-update
Warns about the use ofUNSAFE_componentWillUpdatein class components.