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.

SSR versus CSR and GetServerSideProps with Next.js

SSR versus CSR and GetServerSideProps with Next.js

We're learning my mission and one of the main lesson objectives here is differentiating build time and request time with rendering, depending on the data for fetching data, the type of data we're using, and this is really how you should be looking at leveraging these frameworks and libraries. At least one of the most important ways. If we need to fetch data at request time, you could do static generation, which would be the default, and then bring in a use effect hook, that's one way to do it. But if you have data that's more sensitive and you don't want to rely on use effect because it can briefly show things that you don't want it to show, and you want to keep that information hidden on the server-side till it's ready, for example, it's one use case. That's one example. then I wouldn't recommend that. What I would recommend is server-side rendering with data. In any case, you have to learn SSR if you're going to be working with Next.js. Server-side rendering, we talked about it a…

Contents