babel-plugin-transform-react-remove-prop-types
Advanced tools
Comparing version 0.4.21 to 0.4.22
@@ -191,3 +191,4 @@ "use strict"; | ||
libraries: (state.opts.additionalLibraries || []).concat('prop-types'), | ||
classNameMatchers: classNameMatchers | ||
classNameMatchers: classNameMatchers, | ||
createReactClassName: state.opts.createReactClassName || 'createReactClass' | ||
}; | ||
@@ -230,3 +231,3 @@ | ||
return currentNode.get('callee').node.name === 'createReactClass'; | ||
return currentNode.get('callee').node.name === globalOptions.createReactClassName || currentNode.get('callee').node.property.name === 'createClass'; | ||
}); | ||
@@ -233,0 +234,0 @@ |
{ | ||
"name": "babel-plugin-transform-react-remove-prop-types", | ||
"version": "0.4.21", | ||
"version": "0.4.22", | ||
"description": "Remove unnecessary React propTypes from the production build", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -228,2 +228,18 @@ # babel-plugin-transform-react-remove-prop-types | ||
### `createReactClassName` | ||
Use this option to set a custom name for the import of the `create-react-class` package that is different than `createReactClass`. | ||
Given this example: | ||
```js | ||
import createClass from 'create-react-class'; | ||
``` | ||
You would use: | ||
```js | ||
createReactClassName: 'createClass' | ||
``` | ||
## Is it safe? | ||
@@ -230,0 +246,0 @@ |
@@ -178,2 +178,3 @@ /* eslint-disable global-require, import/no-dynamic-require */ | ||
classNameMatchers, | ||
createReactClassName: state.opts.createReactClassName || 'createReactClass', | ||
} | ||
@@ -225,3 +226,6 @@ | ||
return currentNode.get('callee').node.name === 'createReactClass' | ||
return ( | ||
currentNode.get('callee').node.name === globalOptions.createReactClassName || | ||
currentNode.get('callee').node.property.name === 'createClass' | ||
) | ||
}) | ||
@@ -228,0 +232,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
48962
1045
267