From the course: Master Next.js: Elaborate Hands-On Web Development, React Basics, Advanced Next.js, and Deployment
Unlock this course with a free trial
Join today to access over 25,200 courses taught by industry experts.
Static generation with data in Next.js
From the course: Master Next.js: Elaborate Hands-On Web Development, React Basics, Advanced Next.js, and Deployment
Static generation with data in Next.js
Okay, so let's focus on static generation and let's look at it with and without data. So everything we've worked on up to this point in building this app, we haven't really been thinking about fetching data. In fact, none of the pages, the homepage and blog page require any type of external data. So those pages will automatically be statically generated when the app is built for production because there's no type of calls happening. And without data, this is what it looks like. So static generations, they don't have any data, they get put together at build time. So Next.js has that build, builds the app for the production, the HTML is generated, and then there's no need to fetch any external data. Now for some pages, you may not be able to render the HTML without first fetching some external data. For example, you may need to access a file system, fetch an external API, or query your database at build time. So you have a page with static generation that's going to have some data…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
-
-
-
-
(Locked)
Pre-rendering tests with Next.js6m 53s
-
(Locked)
What is static generation versus server-side rendering with Next.js?4m 17s
-
(Locked)
Static generation with data in Next.js4m 36s
-
(Locked)
Concise basic algorithms for Next.js practice and data processing20m 57s
-
(Locked)
Static generation and GetStaticProps with Next.js20m
-
(Locked)
When to use GetStaticPropsServer with Next.js3m 5s
-
(Locked)
SSR versus CSR and GetServerSideProps with Next.js7m 20s
-
(Locked)
-
-