react-rename-unsafe-lifecycles
Rename deprecated React lifecycle names to their UNSAFE_ equivalents in class components, object literals, and member references.
Usage
bash
Explore community-led codemods to migrate, optimize, and transform your codebase.
Build your own codemod and share it with the community.
Rename deprecated lifecycle methods to UNSAFE_ prefixed versions
Build your own codemod and share it with the community.
1 const React = require('React');
2
3 class Component extends React.Component {
4 componentWillMount() {
5 this.componentWillReceiveProps(this.props);
6 }
7 componentWillReceiveProps() {}
8 render() {
9 return null;
10 }
11 }