I'm curious how React memoization works under the hood.
Specifically, I want to understand the tradeoff between runtime performance gains and memory usage. I want to know what is that total memory usage, and what is the behaviour of the memoization algorithm when React.memo
's dependencies are unstable? If a dependency changes, are multiple copies of the rendered component stored in memory, or just the most recent?
Thanks!