We are in client side?: false
Custom hook that determines if the code is running on the client side (in the browser).
import { isClient } from "@/utils/is-client";
export function useIsClient() {
return isClient();
} <!-- javascript -->
<script lang="ts">
import { useIsClient } from "@dimaslz/svelteuse";
const isClient = useIsClient();
</script>
<!-- html -->
<div>
We are in client side?: {isClient}
</div>