UNPKG

@lobehub/ui

Version:

Lobe UI is an open-source UI component library for building AIGC web apps

15 lines (13 loc) 357 B
import { useEffect, useState } from "react"; //#region src/hooks/useIsClient.ts const useIsClient = () => { const [isClient, setIsClient] = useState(typeof document !== "undefined"); useEffect(() => { if (isClient) return; setIsClient(true); }, []); return isClient; }; //#endregion export { useIsClient }; //# sourceMappingURL=useIsClient.mjs.map