Removing the dependency array in useEffect #29
guillaumebrunerie
started this conversation in
Feature Requests
Replies: 1 comment
-
Great question! You are right that the compiler's analysis gives us a solid foundation to automatically figure out dependencies. What's hard about this is not the compiler implementation, but more so the overall design of effects. We're looking at it holistically across both the runtime and compiler. It's not baked enough for us to share concrete details at this point in time, but this is something we're well aware of and have been doing a lot of active research on. Several of us are working on the useEffect space currently. I hope we can share more soon! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
What are the plans for using the React Compiler to remove the need for having a dependency array in
useEffect
?It feels like it would be pretty easy to have the compiler automatically inject all the right dependencies, and surely this has been discussed internally. Although I guess there are backwards compatibility issues with the fact that not having a dependency array currently means running the effect after each render.
Beta Was this translation helpful? Give feedback.
All reactions