Closed
Description
react/no-unused-prop-types thinks that both the onClick and children props are unused even though these are clearly being used:
type Props = {
onClick: () => void,
children: any,
};
class Button extends Component {
props: Props
render () {
const { props } = this;
return (
<button
onClick={props.onClick}
>
{props.children}
</button>
);
}
}
export default Button;
If I refer to onClick using this.props.onClick or destructure all the props from this.props it works.