Rules
no-component-will-receive-props
Full Name in eslint-plugin-react-x
react-x/no-component-will-receive-propsFull Name in @eslint-react/eslint-plugin
@eslint-react/no-component-will-receive-propsFeatures
🔄
Presets
xrecommendedrecommended-typescriptrecommended-type-checked
Description
Replaces usages of componentWillReceiveProps with UNSAFE_componentWillReceiveProps.
This API has been renamed from componentWillReceiveProps to UNSAFE_componentWillReceiveProps. The old name has been deprecated. In a future major version of React, only the new name will work.
Examples
Before
import React from "react";
class MyComponent extends React.Component {
componentWillReceiveProps() {
// ...
}
}After
import React from "react";
class MyComponent extends React.Component {
UNSAFE_componentWillReceiveProps() {
// ...
}
}Implementation
Further Reading
See Also
- no-component-will-mount
Replace usages ofcomponentWillMountwithUNSAFE_componentWillMount. - no-component-will-update
Replace usages ofcomponentWillUpdatewithUNSAFE_componentWillUpdate.