no-unused-props unable to handle inline functions #1309
Closed
Description
opened on Jul 20, 2017
When you do the following, no-unused-props is triggered even though the props are used:
const Thing = (props) => (
<div>
{(() => {
if(props.enabled){
return (
<span>Enabled!</span>
)
}
return (
<span>Disabled..</span>
)
})()}
</div>
);
Thing.propTypes = {
enabled: React.PropTypes.bool
};
Thing.defaultProps = {
enabled: false
};
export default Thing;
Activity