From the course: Next.js Ecommerce: Build a Shopping Platform from Scratch

Unlock this course with a free trial

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

Loading and not found pages

Loading and not found pages

So now we're going to create a loading page and a not found page and you can do that just by simply calling a page a certain name. So let's start with the loading and this will show when whenever something is loading if you are switching pages or or whatever it might be and you want to show a spinner or you want to show some text. And to do that you just have to go into your app folder and create a file called loading dot and then whatever we're using TypeScript so it's going to be TSX. If you're using JavaScript, it would be JSX or JS. And you can see right away, this breaks because this is not a React component. It's an empty file. So we just need to add here, let's say, SFC. And we'll call it Loading Page. And for now, I'll just say Loading. OK, and if I reload, it's too fast to even see. But I'll show you a trick to test it out in a minute. Let's just get the loader in here. Now, a few videos back, I had you bring in some assets. And in the Assets folder is a loader.gif. And I'm…

Contents