I’m migrating my Next 12 app to Next 13 and its new /app
directory.
I have a <LoginPage>
component (rendered @ /login
) and obviously, it needs to use hooks to manage form data. As such, I have marked it with the 'use client'
directive.
However, that means that the new metadata API can’t be used to set the <title>
, which ideally, I’d like to be something as simple as Login | ${process.env.NEXT_PUBLIC_APP_NAME}
.
Any help is appreciated!
2
Answers
You could use layout in
login
directory.inside layout:
Instead of
Metadata
, you can put the<title>
tag directly intopage.js
among your components.