Replies: 3 comments 11 replies
-
Hey @nandcello, this turns out the React Compiler doesn’t disable the exhaustive-deps rule automatically yet, even if you’ve set reactCompiler: true in your next.config.js. That rule still comes from eslint-plugin-react-hooks, so ESLint continues to warn about missing dependencies until React ships a compiler-aware lint integration. Your setup is fine; it’s just not fully wired up yet in the current Next 16 beta. For now, you can either leave the warning as-is or temporarily disable it in your .eslintrc file or inline comment if it clutters your output. The React team mentioned they’ll release updated lint rules once the compiler becomes stable, so keep an eye on the official React docs once that lands, these redundant warnings should disappear automatically. |
Beta Was this translation helpful? Give feedback.
-
What package manager are you using? |
Beta Was this translation helpful? Give feedback.
-
Okay I think I've finally gotten this to work @icyJoseph @haroonmaqbool; at least until Next team fixes the Here's my import reactHooks from "eslint-plugin-react-hooks";
//other imports..
const eslintConfig = [
reactHooks.configs.flat["recommended-latest"],
...compat.config({
extends: ["next/core-web-vitals", "next/typescript"],
rules: {
"react-hooks/exhaustive-deps": "off",
},
}),
{
ignores: [
"node_modules/**",
".next/**",
"out/**",
"build/**",
"next-env.d.ts",
"convex/_generated/**",
],
},
]; The key thing is the order of the items. If I decalre reactHooks after the compat.config line then I still get exhaustive deps warning when I lint despite react compiler being enabled in next config. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
Trying out Next16 beta and I have reactCompiler option in my next config set to true. When run lint on my project (this is a fresh project btw) it still warns me of exhaustive deps rule when I don't wrap my function in a useCallback which I believe should be taken care of the react compiler.
Additional information
Tried to follow the React guide to enable the lint but to no avail.
also upon checking, i do have [email protected] installed via [email protected]
sample warning
Beta Was this translation helpful? Give feedback.
All reactions