Performance: What is Next.js
MEDIUM IMPACT
Next.js affects page load speed and rendering performance by optimizing server-side rendering and static generation.
import React from 'react'; export default function Page() { return <div>Hello World</div>; } // Next.js pre-renders this page on server or at build time
import React from 'react'; export default function App() { return <div>Hello World</div>; } // Rendered only on client side
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Client-side React only | Many on client after JS loads | Multiple reflows during hydration | High paint cost due to delayed content | [X] Bad |
| Next.js pre-rendered page | Minimal on client at load | Single reflow on initial paint | Low paint cost with fast content display | [OK] Good |