Performance
Performance should be considered from the start. Keep components small, avoid unnecessary re-renders, and load only what is needed.
Guidelines
- Split big components into smaller ones.
- Use
next/dynamic()for rarely visited or heavy views. - Memoize intentionally with
React.memo,useMemo, anduseCallback. - Avoid recreating objects, arrays, or functions inside JSX.
- Use stable keys for lists (never array index).
- Use
<Image>with defined width/height for better optimization. - Virtualize large lists using libraries like
react-windowor@tanstack/react-virtual.