()
| 200 | * until after hydration. |
| 201 | */ |
| 202 | export function useIsSSR(): boolean { |
| 203 | // In React 18, we can use useSyncExternalStore to detect if we're server rendering or hydrating. |
| 204 | if (typeof React['useSyncExternalStore'] === 'function') { |
| 205 | return React['useSyncExternalStore'](subscribe, getSnapshot, getServerSnapshot); |
| 206 | } |
| 207 | |
| 208 | // eslint-disable-next-line react-hooks/rules-of-hooks |
| 209 | return useContext(IsSSRContext); |
| 210 | } |
no outgoing calls
no test coverage detected