Saltar al contenido
← volver

useSyncExternalStore: test snapshot identity and the initial SSR value

DEV · dev.to Publicado:

An external store can notify its subscribers without changing the screen rendered through useSyncExternalStore. After the same snapshot object was mutated in this experiment, the screen still displayed 0 following the notification. The Hook needs a subscription notification and a snapshot that represents the change. With SSR, the initial client read must also receive the value used to generate the server HTML. This test store includes both replacement and a deliberately incorrect mutation for c…

Leer original →

Más de DEV