Skip to content

Commit

Permalink
[eslint-plugin-react-hooks] add test showing broken behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
kassens committed Aug 31, 2022
1 parent 7e5322c commit cfee9e6
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,17 @@ const tests = {
const [myState, setMyState] = useState(null);
}
`,
`
// Valid, but should be invalid. '_useHook' is currently recognized as a component.
function Component(props) {
if (cond) {
_useHook();
}
}
function _useHook() {
useState(null);
}
`,
],
invalid: [
{
Expand Down

0 comments on commit cfee9e6

Please sign in to comment.