All Articles

SGG in Next.js

Allow Next.js to become fully hybrid by providing methods to do both static generation and server-side rendering on a per-page basis.

Two new per-page data fetching methods:

  • getStaticProps - Opt-in to static generation (SSG) at next build time.
  • getServerSideProps - Opt-in to server-side rendering (SSR) which renders on-demand.

A new method for statically generating (SSG) a set of routes from dynamic sources

  • getStaticPaths - Return list of parameters for dynamic routes to do static generation (SSG)

This RFC exclusively discusses API additions. All new functionality is completely backwards compatible and can be incrementally adopted. This RFC introduces no deprecations.