React 19 · Performance and transitions

Cache a function

Keep the same function between renders so memoized children don't re-render.

const onSelect = useCallback((id: string) => setSelected(id), []);

Official React 19 documentation

More performance and transitions commands

All performance and transitions commands · React 19 cheatsheet

Was this page helpful?