1 Introducing Next.js

 

This chapter covers:

  • The types of things that all React applications need to do
  • A conceptual introduction to Next.js
  • Why it can be challenging to build React applications without Next.js

Over the past few years, React has seen massive growth in popularity. One reason for this is due to its low barrier to entry. You don’t require several years of front-end development experience before you can pick up React, tinker with it, and make something useful with it. What enables this ease-of-use is the nature of React itself; it doesn’t have a lot of moving parts which simplifies building components and bringing them together to build functionality. Another ease-of-use factor for React is its tooling. For example, starting a new project is straightforward and doesn’t require that you understand how everything works behind the scenes. Because of Reacts popularity, there’s a huge ecosystem surrounding it. Chances are, that whatever your application needs to do, it doesn’t have to invent it from scratch – there’s probably a package out there with supporting components.

1.1       Common Capabilities of React Applications

1.1.1   Dev Server

1.1.2   Production Build and Production Server

1.1.3   Server-Side Rendering

1.1.4   URL Routing

1.1.5   Page Composition and Styles

1.1.6   Data Fetching and State Management

1.2       Key Next.js Concepts

1.2.1   A Collection of Pages

1.2.2   Routing Happens Automatically

1.2.3   Server-Side Rendering Happens Automatically

1.2.4   API Routes Are Just Like Page Routes

1.2.5   Pages Are React Components

1.2.6   Deploying Pages and APIs as Serverless Functions

1.3       Prior Art Pain Points

1.3.1   Using create-react-app and react-scripts

1.3.2   Managing Routes With react-router

1.3.3   Fetching Data in The Browser and On the Server

1.3.4   Deployment Scaling and Cost Considerations

1.4       What Next.js Is Not

1.4.1   Not a Server-Side Render Utility

1.4.2   No Databases

1.4.3   No UI/UX Workflow

1.4.4   Not a Replacement for What Works

1.5       Summary

sitemap