manifold/web/hooks/use-is-client.ts

8 lines
191 B
TypeScript
Raw Normal View History

import { useEffect, useState } from 'react'
export const useIsClient = () => {
const [isClient, setIsClient] = useState(false)
useEffect(() => setIsClient(true), [])
return isClient
}