Amy Blankenship
Nov 27, 2023

--

Honestly, they guy who wrote this post https://overreacted.io/optimized-for-change/ should have thought of this shit before he went all-in on hooks. But also I think you don't understand the point of useMemo. It's not just about computing expensive values, it's to prevent the creation of an object with a new identity on every render. The React docs claim React is "fast enough" for this not to matter, but their little toy examples don't consider deeply nested dom trees with thousands or millions of elements (which is easy to get to, for example, in a complex table).

--

--

Amy Blankenship
Amy Blankenship

Written by Amy Blankenship

Full Stack developer at fintech company. I mainly write about React, Javascript, Typescript, and testing.

No responses yet