Performance: Public directory for static files
MEDIUM IMPACT
This affects page load speed by serving static assets directly without server processing, improving initial content display.
export default function Header() { return <img src="/logo.png" alt="Logo" />; }
import logo from '../assets/logo.png'; export default function Header() { return <img src={logo} alt="Logo" />; }
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Importing static files in JS bundle | Minimal | 0 | High due to delayed image load | [X] Bad |
| Serving static files from public directory | Minimal | 0 | Low, images load early | [OK] Good |