mihaip / react-closure-compiler

Tooling to teach Closure Compiler about React
Apache License 2.0
100 stars 14 forks source link

Mixin props support #26

Closed arv closed 6 years ago

arv commented 6 years ago

With the latest Closure Compiler I'm getting issues that props inherited from a mixin is not known.

Something like:

const myMixin = React.createMixin({
  propTypes: {
    s: React.PropTypes.string.isRequired,
  },
});

const myComp = React.createClass({
  mixins: [myMixin],
  render() {
    // props has no property 's'
    return <div>{this.props.s}</div>;
  },
});

Consider merging in the propTypes from the mixins.