Option for "constant deps" #65
kurtextrem
started this conversation in
Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi.
We use the following hook in our codebase:
This ensures the return of
useConstant
is constant. This means it's safe not to specify it in dep arrays, similar to how you don't need to specify thesetState
ofuseState
.The various linters have options to skip errors in this case, but the React Compiler doesn't, as far as I can tell.
It would nice to support a similar config in the compiler, so it correctly compiles components that make use of that return in any hook dependencies.
Beta Was this translation helpful? Give feedback.
All reactions