Most React performance work is not about memoisation. It is about finding which state update is causing a subtree to re-render, and moving that state down.
Open the profiler and record a slow interaction. Every optimisation you make without a measurement is a guess, and most guesses make the code harder to read without making it faster.
By far the most common problem is state that lives too high in the tree. When a component high up holds state that only one leaf needs, every sibling re-renders on each update. Moving that state down usually removes the problem entirely.
Memoisation is a tool for when you cannot restructure the tree, not a default. Applied blindly it adds comparison cost and hides the real dependency graph from the next reader.
Stop when the interaction feels instant. Further optimisation has a cost in complexity that will be paid by whoever reads the component next.
When to render on the server and when to pre-render at build time. A practical comparison of SSR, SSG and ISR with the trade-offs that actually matter in production.
Shares performance
A comprehensive demonstration of image and video embedding capabilities in our Next.js blog, showcasing responsive media handling and beautiful typography.
More in this section
A practical guide to incorporating AI capabilities into your web projects using modern JavaScript frameworks and APIs.
More in this section
Discover how AI design tools are transforming the workflow for developers who need to create visually appealing interfaces.
More in this section
Loading comments…