I used a default layout in layout.jsx and as props, I passed all my other pages as children, in page router, we could config router path to define which layout should be used but in this new system, I don't know how to code it.
import "./globals.css"
import Header from "./components/Header"
import { Inter, Poppins } from "next/font/google"
const inter = Inter({ subsets: ["latin"] })
const poppins = Poppins({
weight: ["400", "700"],
subsets: ["latin"],
})
export const metadata = {
title: "Weather app",
description: "Author Sayeed Mahdi Mousavi",
keywords: "weather, teather",
}
export default function RootLayout({ children }) {
return (
<html lang="en">
<body className={poppins.className}>
<Header />
{children}
</body>
</html>
)
}
also, I have another layout for my weather app layout. the below layout is in my weather app folder with the name of the layout.jsx.
import LayoutTailwind from "../components/LayoutTailwind"
const Layout = ({ children }) => {
return (
<>
<LayoutTailwind />
{children}
</>
)
}
export default Layout