UNPKG

avent-ui

Version:

The best UI library for Typescript and React

23 lines (20 loc) 556 B
import { useState, useEffect } from 'react'; function useRenderEnv() { const isServer = (typeof window === 'undefined'); const isClient = (typeof window !== 'undefined'); const [ssr, setIsSsr] = useState({ isServer: isServer, isClient: isClient, isLoading: true, }); useEffect(() => { setIsSsr({ isServer: false, isClient: true, isLoading: false, }); }, []); return ssr; } export { useRenderEnv as default }; //# sourceMappingURL=useRenderEnv.js.map