Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
[eslint-plugin-react-hooks] add test showing broken behavior
  • Loading branch information
kassens committed Aug 31, 2022
commit cfee9e621f0fbf4e33e19b99d261204e11953dea
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