Next.js Discord

Discord Forum

How to create dynamic page title in Next 13 app dir

Answered
Gull-billed Tern posted this in #help-forum
Open in Discord
Gull-billed TernOP
I have a server component below, I want the page name to be the project name from the respionse.

export const metadata: Metadata = { //dynamic page title goes here title: "", description: "", }; export default async function Project({ params: { slug }, }: { params: { slug: string }; }) { const project: ProjectProps = await getProject(slug); ...


With my current code, I'm not sure there's a way I can do that. I tried using the <Head> from next/head but it doesn't work at all.

What can I do?

1 Reply