Closed
Description
opened on Sep 7, 2017
Example snippet:
import React from 'react';
import PropTypes from 'prop-types';
class FalsePositive extends React.PureComponent {
static propTypes = {
list: PropTypes.arrayOf(PropTypes.node).isRequired,
};
render() {
return (
<div>
{this.props.list.map(this.wrap.bind(this, 'span'))}
</div>
);
}
wrap(Tag, item, i) {
return <Tag key={i}>{item}</Tag>;
}
}
export default FalsePositive;
this.wrap.bind
triggers the rule, even though the bound function isn't the actual prop being passed, but is being used during the render to build the children, so it shouldn't break purity.
Activity