By now we validated our props like this:
class HelloEs6 extends React.Component {
render() {
return <div>Hello {this.props.name}</div>;
}
}
HelloEs6.propTypes = {
name: PropTypes.string.isRequired,
};
But after an update of ESLint from v4.19.1 to v5.4.0 we always get the 'is missing in props validation' error.
If we put the validation inside of the class it works perfectly like this:
class HelloEs6 extends React.Component {
render() {
return <div>Hello {this.props.name}</div>;
}
propTypes = {
name: PropTypes.string.isRequired,
};
}
Why is that the case? We couldn't find anything in the changelog according to this.