1/* 2Use this hook if you want to render with react 3ONLY on the client. 4 5This is much better than using process.browser, 6since it will NOT render the thing on the server, 7will render it on the client, and the react SSR 8hydration will not be thrown off like it is with 9process.browser. 10*/ 11 12import { useEffect, useState } from "react"; 13 14export default function useIsClient(): boolean { 15 const [loaded, setLoaded] = useState<boolean>(false); 16 useEffect(() => setLoaded(true), []); 17 return loaded; 18} 19 20