Description
Here is a minimal example that triggers this:
const PagingBlock = function(props) {
return (
<span>
<a onClick={() => props.previousPage()}/>
<a onClick={() => props.nextPage()}/>
</span>
);
};
PagingBlock.propTypes = {
nextPage: React.PropTypes.func.isRequired,
previousPage: React.PropTypes.func.isRequired,
};
The error message is:
18:17 error 'previousPage' PropType is defined but prop is never used react/no-unused-prop-types
Notes:
- Converting this to a React.createClass with static propTypes fixes the issue
- Removing either
<a/>
tag produces the correct lint error, the false error only occurs when both are present - The error is notified for the first tag (switching
nextPage
andpreviousPage
inside the render function will make the error text saynextPage
is defined but not used