Next.js Discord

Discord Forum

how to use generateMetadata with 'use client'

Answered
Ryota Murakami posted this in #help-forum
Open in Discord
I'm confusing, I added generateMetadata into page.tsx, this error message shown that says "you have to choose one 'use client' or 'generateMetadata'".

That's insane question, how can I 'use client' component with update <head> section data by generateMetadata?
Answered by riský
Read this to have some alternatives and reasoning: https://nextjs-faq.com/metadata-client-components
View full answer

2 Replies

Read this to have some alternatives and reasoning: https://nextjs-faq.com/metadata-client-components
Answer
@riský Thank you! I'll search this forum first next time!