Загрузка видео...

Не удалось загрузить видео

На главную

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

91,579 просмотров • 2 лет назад •via X (Twitter)

Комментарии: 10

Фото профиля Alex Sidorenko
Alex Sidorenko2 лет назад

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
Guillermo Rauch2 лет назад

Love that page.client convention. Clean

Фото профиля Alex Sidorenko
Alex Sidorenko2 лет назад

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

Фото профиля عَ
عَ2 лет назад

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

Фото профиля Alex Sidorenko
Alex Sidorenko2 лет назад

Server Actions are designed to be used in client components.

Фото профиля Moti Azu
Moti Azu2 лет назад

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
Ajin2 лет назад

cool

Фото профиля Benzigar Alvin.
Benzigar Alvin.2 лет назад

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

Фото профиля rayyan ✦ design engineer
rayyan ✦ design engineer2 лет назад

i never think of it this way, thanks man

Фото профиля Subhajit Bhar
Subhajit Bhar2 лет назад

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

Похожие видео