React integration

getServerSnapshot

Provides matching initial data for server render and hydration.

Formal Syntax & Structure

react syntaxreact
useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot)

Working Example

Example Snippetreact
useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot)
React Reference