effect dependencies
The reactive inputs that determine when an effect must resynchronize.
Use this when A subscription or request keeps using an old value.
without the term
“When I switch to a different user, the chat still shows messages from the previous one. It's like the effect keeps the old id. Can you fix it so it reconnects when the id changes?”
with the term · How do you ask a model for effect dependencies?
Correct this effect’s dependencies. Keep the linter enabled and verify that changing the selected id cleans up the old subscription.
What is effect dependencies?
In React, an effect must track the reactive values it reads. Dependency identity determines when React reruns it.
Why does effect dependencies matter when vibe coding?
Omitting a dependency can make the page look correct until a prop changes.
How do you do effect dependencies?
Identify the external system and its inputs. Check cleanup and resubscription when an input changes.
What goes wrong with effect dependencies?
A new object on every render causes unnecessary resubscriptions.