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

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

На главную

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

51,557 просмотров • 1 год назад •via X (Twitter)

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

Фото профиля 지후
지후1 год назад

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

Фото профиля chuckstock
chuckstock1 год назад

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

Фото профиля Alex Sidorenko
Alex Sidorenko1 год назад

nope, same result

Фото профиля Kevin Nguyen
Kevin Nguyen1 год назад

This vs. Zustand what is your take?

Фото профиля Alex Sidorenko
Alex Sidorenko1 год назад

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
Qing | quotion.co1 год назад

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

Фото профиля Alex Sidorenko
Alex Sidorenko1 год назад

Why not ideal?

Фото профиля Carlos Terrazas
Carlos Terrazas1 год назад

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
Alex Aaron Peña1 год назад

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

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