@suspensive/react
Version:
Suspensive interfaces for react
14 lines (11 loc) • 412 B
JavaScript
'use client';
import { noop } from "./utils/noop.mjs";
import { useSyncExternalStore } from "react";
//#region src/useIsClient.ts
const emptySubscribe = () => noop;
const getSnapshot = () => true;
const getServerSnapshot = () => false;
const useIsClient = () => useSyncExternalStore(emptySubscribe, getSnapshot, getServerSnapshot);
//#endregion
export { useIsClient };
//# sourceMappingURL=useIsClient.mjs.map