-
Notifications
You must be signed in to change notification settings - Fork 50.5k
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 bugType: Bug
Description
What kind of issue is this?
- React Compiler core (the JS output is incorrect, or your app works incorrectly after optimization)
- babel-plugin-react-compiler (build issue installing or using the Babel plugin)
- eslint-plugin-react-hooks (build issue installing or using the eslint plugin)
- react-compiler-healthcheck (build issue installing or using the healthcheck script)
Link to repro
Repro steps
- Install eslint-plugin-react-hooks@7.0.1 (or latest).
- Create a React component with a clear rule violation (e.g., useMemo with no return value).
- Observe that the linter correctly reports the error.
- Add a try/catch or try/catch/finally block anywhere inside the component body.
- Bug: The linter stops reporting the useMemo error (and all other compiler errors) for that component.
Note: In the React Playground, when recreating the example, I see that the the try/catch/finally block actually throws an error, but the useMemo one is still ignored
Expected Behavior
The linter should flag the useMemo error regardless of the try/catch block present in the component.
Actual Behavior
The linter reports 0 errors. Removing the try/catch block immediately causes the useMemo error to reappear.
How often does this bug happen?
Every time
What version of React are you using?
19.1.1
What version of React Compiler are you using?
I don't use React compiler, but I use eslint-plugin-react-hooks version 7.0.1
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 bugType: Bug