Asad Siddiqui
← Writing

November 15, 2023

What is Next.js and why can it be used instead of Create-React-App (CRA)?

What is Next.js and why can it be used instead of Create-React-App (CRA)?

NextJS is a framework built on top of React, and with additional capabilities like SSR, SSG, routing, data fetching, API routes

  • SSR (Server-side rendering) is when the HTML content of a page is rendered by server upon request before being served to client. This enables getting dynamic content to be in the HTML doc so it can be indexed by SEO. This is opposite to client-side rendering where client would receive a HTML shell (includes basic structure) document with CSS and JS files, and client’s resources would be used to render the content.
  • SSG (Server-side generation) is when HTML doc is rendered at build time and this is suitable for pages with less-frequently updated pages. This results in fast load times as the page has been prepared ever since build time

In comparison to CRA, CRA is a tool made to set up a react app quickly. This includes dev environemtn and build config for client-side rendering. It doesn’t have features like SSG and SSR