babel-plugin-react-rename-unsafe-lifecycle

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

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
babel-plugin-react-rename-unsafe-lifecycle
301.0.45 years ago5 years agoMinified + gzip package size for babel-plugin-react-rename-unsafe-lifecycle in KB

Readme

babel-plugin-react-rename-unsafe-lifecycle
Rename unsafe react lifecycle: componentWillMount by UNSAFEcomponentWillMount, componentWillReceiveProps by UNSAFEcomponentWillReceiveProps and componentWillUpdate by UNSAFEcomponentWillUpdate

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 nodemodules

{
  "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 ;)