# Function useSyncExternalStore

- useSyncExternalStore<Snapshot>(subscribe, getSnapshot, getServerSnapshot?): Snapshot

- #### Type Parameters

  - Snapshot

  #### Parameters

  - subscribe: ((onStoreChange) => (() => void))
    - - (onStoreChange): (() => void)

      - #### Parameters

        - onStoreChange: (() => void)
          - - (): void

            - #### Returns void

        #### Returns (() => void)

        - - (): void

          - #### Returns void

  - getSnapshot: (() => Snapshot)
    - - (): Snapshot

      - #### Returns Snapshot

  - `Optional` getServerSnapshot: (() => Snapshot)
    - - (): Snapshot

      - #### Returns Snapshot

  #### See

  https://github.com/reactwg/react-18/discussions/86

  - Defined in common/temp/node_modules/.pnpm/@types+react@18.3.3/node_modules/@types/react/index.d.ts:2161