Closed
Description
If a prop is only used in the context of nextProps
, the lint rule mistakenly thinks that the prop is never used.
Here's a repro case:
import React, {PropTypes} from "react";
export default React.createClass({
propTypes: {
foo: PropTypes.bool, // this line gets flagged when it shouldn't
bar: PropTypes.func,
},
componentWillReceiveProps (nextProps) {
if (nextProps.foo) {
return;
}
},
render () {
this.props.bar;
return <div />;
}
});
Metadata
Metadata
Assignees
Labels
No labels