Created
January 11, 2024 21:32
-
-
Save GalindoSVQ/9c7c649f75219c83d1fea2c7ddce2220 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as React from "react"; | |
export default function useIsClient() { | |
const [isClient, setIsClient] = React.useState(false); | |
React.useEffect(() => { | |
setIsClient(true); | |
}, []); | |
return isClient; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://stackblitz.com/edit/stackblitz-starters-rgvyku?file=src%2FApp.tsx