Rules
no-component-will-update
Full Name in eslint-plugin-react-x
react-x/no-component-will-updateFull Name in @eslint-react/eslint-plugin
@eslint-react/no-component-will-updateFeatures
🔄
Presets
- x
- recommended
- recommended-typescript
- recommended-type-checked
Description
Replaces usages of componentWillUpdate with UNSAFE_componentWillUpdate.
This API has been renamed from componentWillUpdate to UNSAFE_componentWillUpdate. 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 {
  componentWillUpdate() {
    // ...
  }
}After
import React from "react";
class MyComponent extends React.Component {
  UNSAFE_componentWillUpdate() {
    // ...
  }
}Implementation
Further Reading
See Also
- no-component-will-mount
 Replaces usages ofcomponentWillMountwithUNSAFE_componentWillMount.
- no-component-will-receive-props
 Replaces usages ofcomponentWillReceivePropswithUNSAFE_componentWillReceiveProps.