Layouts & nested layouts
Every real app has a chrome that stays put — a top bar, a sidebar, a footer — while the middle swaps as you click around. Layouts are how Next.js gives you that for free. Misunderstand one thing about them (that they persist and do NOT re-render on navigation) and you will write fetches that never refresh and waste hours debugging a sidebar that keeps resetting.
try to break it
you drive.
Click a child route to "navigate". The pathless parent (<AppLayout/>) wraps every child.
This input lives in the layout. Switch tabs — your text stays.
The index route — shown by default when the URL is exactly the parent path.
The pathless <AppLayout/> mounts once and stays put — only the <Outlet/> swaps as you navigate. Your sidebar text and the layout mounted 1× badge prove it. With no child segment, the index route fills the Outlet.