Using eslint-plugin-react-hooks
together with eslint-plugin-react-compiler
#18
Replies: 3 comments 1 reply
-
Sorry about the late response! Yeah, you can disable the exhaustive-deps rule if you're using the compiler's linter. The rules of hooks eslint rule is still helpful to have, although in most cases the compiler's linter should catch them too. It's a little duplicative right now but we are planning on merging these plugins in the near future. Thanks for the feedback! |
Beta Was this translation helpful? Give feedback.
-
The issue I have with disabling the Caution The 'defaultValues' object makes the dependencies of useEffect Hook (at line 130) change on every render. To fix this, wrap the initialization of 'defaultValues' in its own useMemo() Hook. eslint(react-hooks/exhaustive-deps) But it will fail to catch missing dependencies for our Caution React Hook useEffect has a missing dependency: 'form'. Either include it or remove the dependency array. eslint(react-hooks/exhaustive-deps) I think the issue is that the rule is doing 2 different things. I hope the |
Beta Was this translation helpful? Give feedback.
-
Hi, |
Beta Was this translation helpful? Give feedback.
-
Hi all! Just started experimenting with the React Compiler and was wondering if the rules for exhaustive deps are correct when using the compiler?
I assumed that it wasn't necessary to use
useCallback
anymore on a function as a dependency, but theeslint-plugin-react-hooks
plugin doesn't seem to agree? (Trying out the RC version5.1.0-rc-8269d55d-20240802
as well just to see if I missed anything). Should I use this plugin at all when using the compiler?Given the code below:
Beta Was this translation helpful? Give feedback.
All reactions