Video yükleniyor...

Video Yüklenemedi

Ana Sayfaya Dön

"How to share state between React client components with a parent server component?" 👇

51,480 görüntüleme • 1 yıl önce •via X (Twitter)

9 Yorum

지후 profil fotoğrafı
지후1 yıl önce

Although it’s quite obvious, you did not add count-provider code

chuckstock profil fotoğrafı
chuckstock1 yıl önce

is there a reason for using `use` instead of `useContext`?

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

nope, same result

Kevin Nguyen profil fotoğrafı
Kevin Nguyen1 yıl önce

This vs. Zustand what is your take?

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

Depends on the type of the app. If it's an interaction-heavy app with a lot of state sharing -> client state lib, if not, context provider here and there is fine

Qing | quotion.co profil fotoğrafı
Qing | quotion.co1 yıl önce

This looks obvious, but what about sharing state between server and client components? I’m using queryparams, not ideal tbh

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

Why not ideal?

Carlos Terrazas profil fotoğrafı
Carlos Terrazas1 yıl önce

wouldn't it be better to zustand in each client component and thus avoid adding code in the server component? or is it just the demo with contextApi?

Alex Aaron Peña profil fotoğrafı
Alex Aaron Peña1 yıl önce

if the context is defined server side, doesn’t this imply the single context is shared across all users visiting the web app? as I understand if I define a zustand datastore, wrap it in a provider, mount it on a server component, all users will share the same store

Benzer Videolar