MCPcopy Index your code
hub / github.com/adobe/react-spectrum / useIsSSR

Function useIsSSR

packages/react-aria/src/ssr/SSRProvider.tsx:202–210  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

200 * until after hydration.
201 */
202export 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}

Callers 15

useInteractionModalityFunction · 0.90
useViewportSizeFunction · 0.90
CollectionRootFunction · 0.90
useDefaultLocaleFunction · 0.90
OverlayFunction · 0.90
OverlayContainerFunction · 0.90
useDisclosureFunction · 0.90
Toast.tsxFile · 0.90
useMatchedBreakpointsFunction · 0.90
useMediaQueryFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected