Performance: Loading UI with loading.tsx
MEDIUM IMPACT
This affects the perceived page load speed and interaction responsiveness by showing a placeholder UI during data fetching or component loading.
export default function Loading() { return <div aria-busy="true" aria-label="Loading content" style={{fontSize: '1.2rem'}}>Loading...</div>; }
export default function Loading() { return <div>Loading full spinner with heavy SVG and animations</div>; }
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Heavy animated spinner in loading.tsx | Moderate (multiple nodes) | Multiple reflows due to animation | High paint cost | [X] Bad |
| Simple text or minimal placeholder in loading.tsx | Low (single node) | Single reflow | Low paint cost | [OK] Good |