Video wird geladen...

Video konnte nicht geladen werden

Zur Startseite

New Recipe: "Sharing data with Client Components" Learn how to use promises to unblock your page so it can be rendered (or even prerendered) as early as possible. Hope you enjoy!

18,841 Aufrufe • vor 10 Monaten •via X (Twitter)

13 Kommentare

Profilbild von Bakemono (Fra) 👹
Bakemono (Fra) 👹vor 10 Monaten

🧑‍🍳

Profilbild von Muhammad Shahzad Ali
Muhammad Shahzad Alivor 10 Monaten

Great Sam, this pattern can be used for sharing page date to layouts as well cache from react

Profilbild von Robert Crocker
Robert Crockervor 10 Monaten

There we go! Hello Next Recipes 👋

Profilbild von Jason Rai
Jason Raivor 10 Monaten

This is the best way I’ve seen this explained so far. Nice job.

Profilbild von Jesper
Jespervor 10 Monaten

@aurorascharff Love the direction with Cache Components and "use cache". But enabling it wraps all routes in <Activity>, meaning routes no longer unmount. We have hundreds of forms and route-level state that rely on unmounting to reset, which is a blocker. Please let us opt out og this!

Profilbild von Mehdi
Mehdivor 10 Monaten

Looks great ! Thanks for the explainer

Profilbild von Jake Klinehamer
Jake Klinehamervor 10 Monaten

How does this work with pre-fetching? If I have a <Link preload={true}> to another page, and that page's tree has a client component wrapped in <Suspense> that calls the hook from your example, does NextJS know to pre-fetch the same way it would if I called getCurrentUser() from a server component?

Profilbild von Sam Selikoff
Sam Selikoffvor 10 Monaten

Yep, since it’s still the server component providing the data during render 👍

Profilbild von Tobi Mey (YouTube)
Tobi Mey (YouTube)vor 10 Monaten

great article thanks!

Profilbild von Terry Carson
Terry Carsonvor 10 Monaten

Thanks

Profilbild von JA
JAvor 10 Monaten

Nextjs is still alive?

Profilbild von juan ferreras
juan ferrerasvor 9 Monaten

It wasn't obvious to me that this recipe would be compatible with cacheComponents. Pretty cool that it seems to be

Profilbild von Sam Selikoff
Sam Selikoffvor 9 Monaten

Absolutely is!

Ähnliche Videos