Closed
Description
openedon Aug 24, 2018
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Metadata
Assignees
Labels
No labels