Menu
Coddy logo textTech

Recap: Layouts

Part of the Next.js Essentials section of Coddy's React journey — lesson 16 of 47.

challenge icon

Challenge

Medium

Chapter recap: give Coddy Eats its shell: a shared nav and real tab titles.

  1. In app/layout.jsx, inside <body> and above {children}, add a <nav> with id="nav" holding a <Link> to / with id="home-link" and the text Home, and a <Link> to /menu with id="menu-link" and the text Menu.
  2. Still in the layout, change the metadata title to exactly Coddy Eats.
  3. In app/menu/page.jsx, export a metadata object with the title Our Menu, so the menu tab names itself.

The tests read the tab title on both pages and check the nav is still there after moving to /menu.

Try it yourself

import './globals.css';
import Link from 'next/link';

export const metadata = {
    title: 'My App',
};

export default function RootLayout({ children }) {
    return (
        <html lang="en">
            <body>
                {children}
            </body>
        </html>
    );
}

All lessons in Next.js Essentials