babel-plugin-react-rename-unsafe-lifecycle

1.0.4 • Public • Published

babel-plugin-react-rename-unsafe-lifecycle

Rename unsafe react lifecycle: componentWillMount by UNSAFE_componentWillMount, componentWillReceiveProps by UNSAFE_componentWillReceiveProps and componentWillUpdate by UNSAFE_componentWillUpdate

Update your .babelrc if you want to continue using componentWill*

{
  "plugins": [
    ["react-rename-unsafe-lifecycle"]
  ]
}

Update Your package.json if you want to update your node_modules

{
  "scripts": {
    "postinstall": "jscodeshift --silent --babel --transform ./node_modules/babel-plugin-react-rename-unsafe-lifecycle/lib/rename-unsafe-lifecycles.js */react-*/**.js --ignore-pattern */react-native/",
  }
}
 

Thx to jscodeshift ;)

Package Sidebar

Install

npm i babel-plugin-react-rename-unsafe-lifecycle

Weekly Downloads

204

Version

1.0.4

License

ISC

Unpacked Size

4.22 kB

Total Files

4

Last publish

Collaborators

  • gsarfati