From the course: The Freelance Stack: Real Project with Next.js and Strapi

Unlock this course with a free trial

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

Layouting in Next.js

Layouting in Next.js

Cool, so we have one very very simple route and I know you're aware that this will get a lot more difficult and there were a lot more different dynamic parameters we're going to be including, but that is generally the logic. Now what we want to build on top of that is we want to have a certain layout for our page. So where would we add that, right? Because for example if we had a header as our component, we would not want to have to bring that in into every one of our pages. Okay, so what I'm going to do here is I'm going to create a new folder called components and I'm also going to put an underscore right in front of it just so that I always have it at the top because everything else in the app folder will be its own page somewhere within a route. So in here I'm going to go and say I have a header.jsx just like that. You can also use np in here but then I don't want to have a page, I want to have my header like this, and I'm just going to give this also the header tag, which is not…

Contents