useMemoCaching expensive work
The same calculation (counting primes in a range), with a switch for whether it goes through the useMemo cache, timing the same re-render either way.
Press “force a re-render” — that state has nothing to do with the calculation, yet the right panel recomputes anyway. That is the problem useMemo solves.
Read the write-up →—msthis re-render
- primes found
- 4,203
- render count
- #0

