Video yükleniyor...
Video Yüklenemedi
How to use Next.js metadata if the page is a client component
91,579 görüntüleme • 1 yıl önce •via X (Twitter)
10 Yorum

This is a quick fix for when you are refactoring your codebase to the App Router and want to quickly add metadata to existing pages with interactivity. But ideally, it's better to isolate interactive bits closer to where they're needed.

Love that page.client convention. Clean

Yes! It's from the Next Discord FAQ. Props to Vũ Văn Dũng (not sure what's the right X handle)

Can I do the same thing to call server actions or get cookie information ? 🤔

Server Actions are designed to be used in client components.

You literally made the page not a client component. I like the naming convention you used though. But you didn’t use metadata in a client component.

cool

nice idea, wrapping client component inside server component. 👍🏻

i never think of it this way, thanks man

I'm learning next.js. this is very useful for me. Thanks for sharing 🙏🏼
Benzer Videolar
How to recover from a server component error in Next.js
Alex Sidorenko
67,557 görüntüleme • 1 yıl önce

