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
- Cache a calculation
- Skip re-rendering a component
- Keep the UI responsive during an update
- Load a component on demand
All performance and transitions commands · React 19 cheatsheet