Skip to content

Instantly share code, notes, and snippets.

@SantoshCode
Last active June 23, 2021 16:19
Show Gist options
  • Save SantoshCode/51fe3c961f518327eec87946ac180aa3 to your computer and use it in GitHub Desktop.
Save SantoshCode/51fe3c961f518327eec87946ac180aa3 to your computer and use it in GitHub Desktop.

Next.js

The React Framework for Production (A fullstack framework for ReactJS)

By default React is a JavaScript library for building user interfaces

NextJS solves common problems and makes building React apps easier!

In React, for routing we have to use third party libraries for handling various features like for routing we might use react-router-dom.

We are still gonna write React code. NextJS just enhances your React app and adds more feature.

In production there are certain problems which we will need to solve for almost all production-ready React apps: NextJS solves those for us like SEO

NextJS - Key Features & Benefits

  • Built-in Server-side Rendering

    Building every single page in server. React alone is a Client Side Render which on demand manupulates the dom to create a new site according to url. In CSR initial loading is an issue. CSR also affects SEO. As Google crawlers might only see inital empty html with bundle.js which is bad for SEO but it might not be a proble for a login dashboard type of applications. TLDR: SSR means we get totally loaded html page from server. So there will be no any loading state for User experience as well as for SEO(google crawlers)

  • File-based Routing

    • Define pages and routes with files and folders instead of code
    • Less code, less work, highly understandable
  • Fullstack Capabilities

    • Easily add backend (server-side) code to your Next/React apps
    • Storing data, getting data, authentication etc, can be added to your React projects
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment