( subscribe: (() => void) => () => void, getSnapshot: () => T, getServerSnapshot?: () => T, )
| 551 | } |
| 552 | |
| 553 | function useSyncExternalStore<T>( |
| 554 | subscribe: (() => void) => () => void, |
| 555 | getSnapshot: () => T, |
| 556 | getServerSnapshot?: () => T, |
| 557 | ): T { |
| 558 | if (getServerSnapshot === undefined) { |
| 559 | throw new Error( |
| 560 | 'Missing getServerSnapshot, which is required for ' + |
| 561 | 'server-rendered content. Will revert to client rendering.', |
| 562 | ); |
| 563 | } |
| 564 | return getServerSnapshot(); |
| 565 | } |
| 566 | |
| 567 | function useDeferredValue<T>(value: T, initialValue?: T): T { |
| 568 | resolveCurrentlyRenderingComponent(); |