afaik, the layout.tsx in the app directory is the root layout and in order to opt out of this layout structure, one can use Route Groups source
wherein (directory_name) containing layout.tsx will be followed for any page.tsx inside this directory
layout.tsx (app directory)
import Link from 'next/link' import './globals.css' export const metadata = { title: 'Create Next App', description: 'Generated by create next app', } export default function RootLayout({ children, }: { children: React.ReactNode }) { return ( <html lang="en"> <body> <nav className='navbar'> <h1><Link href={'/'}>Home</Link></h1> <h1><Link href={'/wikirocket'}>WikiRocket</Link></h1> <h3><Link href={'/about'}>About</Link></h3> <h3><Link href={'/users'}>Users</Link></h3> </nav> {children} </body> </html> ) } layout.tsx (inside (wikirocket) directory)
import Navbar from './wikirocket/components/Navbar' export const metadata = { title: 'Create Next App', description: 'Generated by create next app', } export default function RootLayout({children}: { children: React.ReactNode }) { return ( <html lang="en"> <body className='bg-slate-800 text-cyan-200'> <Navbar /> {children} </body> </html> ) } thus when i run http://localhost:3000/wikirocket
i should not see the navbar displayed through the app layout but i still see it displayed for a brief second and immediately followed by the following errors:
removing the html tag from the wikirocket directory layout.tsx only gets rid of one error which specifies the problem
i just dont want to see the navbar from the app layout.tsx and let the layout.tsx inside (wikirocket) directory override the prev one
