1.0.0 • Published 9 years ago

bloody-strip-proptypes v1.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
9 years ago

strip-proptypes

Build Status

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

license