From the course: Learning Next.js

Unlock the full course today

Join today to access over 23,200 courses taught by industry experts.

Challenge: Pre-rendering at build vs. runtime

Challenge: Pre-rendering at build vs. runtime

From the course: Learning Next.js

Challenge: Pre-rendering at build vs. runtime

(upbeat music) - [Instructor] Now, it's time for the challenge. In this chapter, we learned how to fetch and pre-render data depending on the use case. So when you build your application, next is to transform your code into production optimized files ready to be deployed to servers and consumed by users. So we have three methods of pre-rendering. First, GetStaticProps that rends at built time, GetServerSideProps that rends during request time, and also GetStaticPaths that also rends during built time and is used to generate predefined path. So let's go back to the homepage. So that's going to be actually the starter project. So you already have some setup. So the Top Stories, the Popular stories, that we know already, and you already have also the text input. And here you have an extra option, which is to navigate to a list of sections. For now, it's not set up. That's why we have a Not Found page. So the task will…

Contents