Home

Awesome

DEPRECATED: strip-proptypes

Build Status

Use babel-plugin-transform-react-remove-prop-types, which is both compatible with Babel 6 and removes propType declarations from stateless functional components.

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