From the course: Learning Next.js

Unlock the full course today

Join today to access over 24,600 courses taught by industry experts.

Enable streaming and partial rendering with a loading page

Enable streaming and partial rendering with a loading page

From the course: Learning Next.js

Enable streaming and partial rendering with a loading page

Streaming comes built-in by default with Next.js app router, so streaming is a data transfer technique allowing to break down the routes into smaller chunks in order to progressively stream the data from the server as it becomes readily available. And so streaming comes with many benefits. It allows to avoid slower data requests and also to provide a better user experience, so users don't have to experience a blank page while they wait for the page to load. So in this video, we learn to implement streaming by adding a loading page at the page level. So we're going to go find this segment. So we're going to open the folder structure. And we're going to find here at this level of the page. And this is where we want to implement streaming by adding a loading page. So I'm going to create a new file that's going to be called 'loading.tsx'. All right. And I'm going to export a react component like this. And I'm going to name this one Loading. And very simple I'm just going to return Loading…

Contents