-2

I have a main layout which is rootLayout. And now i create the layout for blog which is BlogLayout but i don't know why i'm getting the errors. Is there a way to fix them ?

enter image description here

enter image description here

juliomalves
  • 42,130
  • 20
  • 150
  • 146
sohaib
  • 574
  • 5
  • 16
  • you passed children to **BlogLayout** the error I guess is ValidateDOMNesting witch comes from these children . edit your question and add the children you passed to this component – monim Jun 30 '23 at 16:01

1 Answers1

0

The issue is resolved.In route layout the navbar will come inside the body.

import "./globals.css";
import { Inter } from "next/font/google";

const inter = Inter({ subsets: ["latin"] });

export const metadata = {
  title: "Create Next App",
  description: "Generated by create next app",
};

export default function RootLayout({ children }) {
  return (
    <html lang="en">
      <body className={inter.className}>
        <nav>Hey i'm main layout</nav>
        {children}
      </body>
    </html>
  );
}
sohaib
  • 574
  • 5
  • 16