-
Notifications
You must be signed in to change notification settings - Fork 49.6k
Open
Labels
Status: UnconfirmedA potential issue that we haven't yet confirmed as a bugA potential issue that we haven't yet confirmed as a bug
Description
In my app a zustand store is exported. These stores act as a hook, or have .getState/.setState on them. In some place I ended up using it as a value.
I only added the hooks plugin as the release notes say: If you have already installed eslint-plugin-react-compiler, you can now remove it and use eslint-plugin-react-hooks@latest
However, the plugin-react-compiler is catching this error that the hooks plugin is not. Resulting in the file silently failing to be optimized.
React version: 19.2.0
eslint-plugin-react-hooks: 7.0.0
Steps To Reproduce
- Use eslint-plugin-react-hooks
- Use a hook as a value (e.g. console.log it)
- In the repro, run npm run lint. You can see the compiler plugin erroring while the react-hooks plugin does not.
Link to code example: https://stackblitz.com/edit/vitejs-vite-asgtyazp?file=src%2FApp.tsx&view=editor
The current behavior
The compiler will skip the offending component silently.
The expected behavior
Eslint rule warns/errors as it does on the playground.
Metadata
Metadata
Assignees
Labels
Status: UnconfirmedA potential issue that we haven't yet confirmed as a bugA potential issue that we haven't yet confirmed as a bug