4 ms·
> You forget one value in your dependency list and the weirdest things happen. Don't you get eslint warnings right in your editor? If you're using VS Code the
by wayneftw 5y ago
> You forget one value in your dependency list and the weirdest things happen.
Don't you get eslint warnings right in your editor?
If you're using VS Code there's an extension for that...
- Waterluvian 5y agoNot only this but I need the freedom to control the dependency list for an effect. Sometimes it isn't as simple as "every variable being referenced inside the effect."
- MispelledToyota 5y agothat's a bit confusing. While you can sometimes get away with leaving out dependencies, and then you don't have to useMemo or useCallback as often, it seems like there is a much larger downside to having potentially stale values in your effect. Leaving them out to me would result in the potential for weird future bugs and race conditions.