Replies: 2 comments
-
hi @amaioru0 |
Beta Was this translation helpful? Give feedback.
-
Hi @amaioru0 👋 In addition to what @BC-krasnoshapka mentioned, server components introduce a couple other cool patterns that can be leveraged to pass or mutate data in client components. Lee Rob (VP Product, Vercel) posted a tweet showing how server and client components can be combined to get a similar experience as getServerSideProps. If you are looking to mutate data on the client, you can also pass server actions to client components - in this case, you would grab the customer ID from within the server action code, since that does run on the server. |
Beta Was this translation helpful? Give feedback.
-
Hi there,
I am wondering how I can use client.fetch on a client component?
When I try to use it I can't because it needs const customerId = await getSessionCustomerId(); but that requires next/headers which only work on server components.
Beta Was this translation helpful? Give feedback.
All reactions