UNPKG

@base-ui/react

Version:

Base UI is a library of headless ('unstyled') React components and low-level hooks. You gain complete control over your app's CSS and accessibility features.

19 lines (18 loc) 475 B
import { useSyncExternalStore } from 'use-sync-external-store/shim'; import { NOOP } from "../internals/noop.js"; function subscribe() { return NOOP; } function getSnapshot() { return false; } function getServerSnapshot() { return true; } /** * Returns `true` while React is hydrating server-rendered markup and `false` * for fresh client-only mounts. */ export function useIsHydrating() { return useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot); }