3 ms·
What is cache in this context? useState? What do you mean by cache invalidation in react apps?
by tiborsaas 9mo ago
What is cache in this context? useState? What do you mean by cache invalidation in react apps?
- azangru 9mo agoStale closures, perhaps.
- danabramov 9mo agoIt never happens if you enable the lint rule.
- azangru 9mo agoI remember how react team's message, around the time hooks were introduced, was how hooks were going to save us from the tyranny of `this`, which people presumably found confusing. I often think back to that message, while adding things in a dependency array. Especially those things that I know won't change (e.g. the redux `dispatch` function pulled from the context), but the linter doesn't. Or while being admonished by the linter for reading from a ref, or writing to it.