Video yükleniyor...

Video Yüklenemedi

Ana Sayfaya Dön

How to use Next.js metadata if the page is a client component

91,579 görüntüleme • 2 yıl önce •via X (Twitter)

10 Yorum

Alex Sidorenko profil fotoğrafı
Alex Sidorenko2 yıl önce

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.

Guillermo Rauch profil fotoğrafı
Guillermo Rauch2 yıl önce

Love that page.client convention. Clean

Alex Sidorenko profil fotoğrafı
Alex Sidorenko2 yıl önce

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

عَ profil fotoğrafı
عَ2 yıl önce

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

Alex Sidorenko profil fotoğrafı
Alex Sidorenko2 yıl önce

Server Actions are designed to be used in client components.

Moti Azu profil fotoğrafı
Moti Azu2 yıl önce

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.

Ajin profil fotoğrafı
Ajin2 yıl önce

cool

Benzigar Alvin. profil fotoğrafı
Benzigar Alvin.2 yıl önce

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

rayyan ✦ design engineer profil fotoğrafı
rayyan ✦ design engineer2 yıl önce

i never think of it this way, thanks man

Subhajit Bhar profil fotoğrafı
Subhajit Bhar2 yıl önce

I'm learning next.js. this is very useful for me. Thanks for sharing 🙏🏼

Benzer Videolar