Skip to content

Instantly share code, notes, and snippets.

@GalindoSVQ
Created January 11, 2024 21:32
Show Gist options
  • Save GalindoSVQ/9c7c649f75219c83d1fea2c7ddce2220 to your computer and use it in GitHub Desktop.
Save GalindoSVQ/9c7c649f75219c83d1fea2c7ddce2220 to your computer and use it in GitHub Desktop.
import * as React from "react";
export default function useIsClient() {
const [isClient, setIsClient] = React.useState(false);
React.useEffect(() => {
setIsClient(true);
}, []);
return isClient;
}
@GalindoSVQ
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment