Closed
Description
I came across some code looking like this where myProp
was reportedly not being used, even though it was.
render() {
const { props } = this;
const { myProp } = props;
someFunction(myProp)
}
MyComponent.propTypes = {
myProp: PropTypes.number,
};
It seems the double desctructure confused the rule because a change to the code below fixed it.
render() {
const { myProp } = this.props;
someFunction(myProp)
}
I think it may be similar to #933, except this one is not such an anti-pattern. It looks very strange on my reduced version, but in a context with more variables can be more natural.