Загрузка видео...
Не удалось загрузить видео
Client/Server composition with server components feels illegal 😅
69,150 просмотров • 2 лет назад •via X (Twitter)
Комментарии: 10

This can be done with the same number of lines using regular REST. But with rate limiting, caching, proper security, and separation of concerns.

Can someone tell me what's the benefit vs calling API and update result on the client again? Not talking about you don't need "backend"

I think it's mainly this 1. Eliminate the problem of duplicating and synchronizing the data state on the client 2. Great potential for shared full-stack components in the future

So having a key on the Suspense forces the server component to rerun? 🤔

The server component reruns because of the query params updates (regardless of the key on the Suspense). The key on the Suspense re-triggers the suspense fallback on every re-run. Here is how it would work without it.

It’s legal though 😂

This is actually incredible 🤯

Can you please make a @YouTube tutorial for all these...

@YouTube What would you like to see in a tutorial?

These tutorials are always great man, Next.js is awesome!
Похожие видео
Moving data fetching between client and server with SWR
Alex Sidorenko
33,430 просмотров • 1 год назад
