Next.js Discord

Discord Forum

Best practice for metadata and client side pages

Answered
Nile Crocodile posted this in #help-forum
Open in Discord
Nile CrocodileOP
I have an app with quite some pages. All of them are marked with "use client", but now I need to properly set metadata for each page (title, description, og-image). I understand that this is the way to do it: https://nextjs.org/docs/app/building-your-application/optimizing/metadata but this does not work with the "use client".
Should I refactor every page and extract the client side to e separate component and leave the page.tsx without the "use client"? Or is there a better way to do it?
Answered by Rafael Almeida
yeah, it is not a good idea to have pages as client components anyway. if you do this then you are unable to use server components down the tree
View full answer

2 Replies

yeah, it is not a good idea to have pages as client components anyway. if you do this then you are unable to use server components down the tree
Answer