Next.js

Wat is Next.js en waarom gebruik je het?

Next.js is een React framework met server-side rendering, static generation, API routes.

Home/Categorieën/Next.js/Wat is Next.js en waarom gebruik je het?

Next.js voordelen

SSR - server-side rendering voor SEO SSG - static site generation API Routes - backend in dezelfde app Image optimization Auto-routing: bestandsnaam = route

Code Voorbeelden

JAVASCRIPTNext.js page
// app/page.tsx - automatisch route /
export default function Home() {
  return <h1>Welkom!</h1>;
}

// app/about/page.tsx - automatisch route /about
export default function About() {
  return <h1>Over ons</h1>;
}

Relevante trefwoorden

Next.jsSSRSSG