Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs: Confusing/Incomplete docs for setting page title (App Router) #65184

Open
Badestrand opened this issue Apr 30, 2024 · 1 comment
Open
Labels
Documentation Related to Next.js' official documentation.

Comments

@Badestrand
Copy link

Badestrand commented Apr 30, 2024

What is the update you wish to see?

Make it easier to find how to update the page title for App Router.

Even with a long search the only thing I could find about setting the page title is https://nextjs.org/docs/app/api-reference/functions/generate-metadata and this only works for server components. I use client components, so what would I use instead? Even after a long time searching in the docs I can't find it.

In the docs to generateMetadata there is a "Good to know" at the top which states that it works only with server components. Please in this same area refer to how to set the title with client components. If it's not possible, write that in there.

Is there any context that might help us understand?

I am using Next.js for many years now and the app router since around one year. I just now spent 30 minutes on trying to find how to set the page title and can't make it work. It's so frustrating and I feel it should be so simple and actually it was so simple with how it was before the app router, just using Head.

Just to clarify, I am not even looking for an answer here, I just want the docs to be updated so that others like me can find the answer quicker, or at all.

Does the docs page already exist? Please link to it.

No response

@Badestrand Badestrand added the Documentation Related to Next.js' official documentation. label Apr 30, 2024
@Badestrand
Copy link
Author

I found this discussion and it seems that it is not possible for client components to update the page title, or only via document.title = .... So would be great to have that information in the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Related to Next.js' official documentation.
Projects
None yet
Development

No branches or pull requests

1 participant