3 ms·
Maybe they forgot some `memo` so it re-renders everything including iframes all the time.
by silverwind 3y ago
Maybe they forgot some `memo` so it re-renders everything including iframes all the time.
- danabramov 3y ago1) In React, re-renders don't destroy the DOM. So nothing would happen if iframes were re-rendered. 2) Rather, we intentionally unload interactive editor preview iframes to improve memory usage when you scroll away from them. We do load them again when you scroll up — and normally that would be instant because the code for them would get cached. But the author has intentionally disabled cache, so as a result they get arbitrarily high numbers when scrolling up and down.