strip-proptypes
install
$ npm install bloody-strip-proptypes
what it does
in production, react doesn't check propTypes
. this plugin removes the
static propTypes
declarations in ES6 classes.
class extends Component {
static contextTypes = {
router: PropTypes.func,
}
static propTypes = {
content: PropTypes.string,
}
render() {
return (
<div />
)
}
}
will be transformed into
class extends Component {
static contextTypes = {
router: PropTypes.func,
}
render() {
return (
<div />
)
}
}
usage
$ babel --plugins bloody-strip-proptypes source.js