eslint-plugin-react-hooks
is not detecting a useEffectEvent
usage violation when it is used inline (i.e. not reassigned to a variable).
React version: 19.2.0
eslint-plugin-react-hooks
version: 7.0.0
Steps To Reproduce
Code example:
import { useEffectEvent } from "react";
function App() {
// ❌ should throw error. Effect event can't be passed down.
return <Component cb={useEffectEvent(() => {})} />;
}
function Component() {
return <></>;
}
The current behavior
Linter gives no error.
The expected behavior
Linter gives an error disallowing useEffectEvent
callback from being passed down.