3 ms·
As in useMemo to make API calls? That is definitely not correct. React explicitly makes no guarantees about how infrequently the fn is called or how long the va
by madeofpalk 2y ago
As in useMemo to make API calls? That is definitely not correct. React explicitly makes no guarantees about how infrequently the fn is called or how long the value is cached for.
- Rapzid 2y agoIt doesn't matter for 99.9% of use cases how long React caches it if your using it to debounce read requests.
- madeofpalk 2y agoSure, if you're using it to memoize a calculation. But triggering an api request having side effects is 100% incorrect.
- Rapzid 2y agoWhy?