Dynamically set page title in app router (RSC)
How do I set the browser title dynamically (say using some data from supabase that runs on server side).
I can do it using RSC or client side just don't know how to do this dynamically.
Solution:Jump to solution
https://nextjs.org/docs/app/api-reference/functions/generate-metadata
You can use
generateMetadata({ params })
...Functions: generateMetadata | Next.js
Learn how to add Metadata to your Next.js application for improved search engine optimization (SEO) and web shareability.
3 Replies
Solution
https://nextjs.org/docs/app/api-reference/functions/generate-metadata
You can use
generateMetadata({ params })
Functions: generateMetadata | Next.js
Learn how to add Metadata to your Next.js application for improved search engine optimization (SEO) and web shareability.
It's exactly the same as
metadata
, just as an async function that must return an object, as you would expectThanks!