[Bug]: prop-types, triggers on properties called props
that are not component props
#3861
Open
2 tasks done
Labels
Is there an existing issue for this?
Description Overview
The
prop-types
rule appears to trigger on arbitrary arrow functions inside the lexical scope of a function component, which access any variable namedprops
even if that variable is declared as a parameter of said arrow functions, even if the component itself doesn't even bind theprops
name and the arrow function thus is not shadowing it.Renaming
props
to something else, does not error. E.g.Expected Behavior
The
prop-types
rule should not trigger a lint error on this case. Theprops
variable in question has nothing to do with component props.eslint-plugin-react version
v7.37.2
eslint version
v8.57.1
node version
v20.12.2
The text was updated successfully, but these errors were encountered: