@ark-ui/solid
Version:
A collection of unstyled, accessible UI components for Solid, utilizing state machines for seamless interaction.
16 lines (14 loc) • 357 B
JSX
// src/components/client-only/client-only.tsx
import { Show, createSignal, onMount } from "solid-js";
function ClientOnly(props) {
const [isClient, setIsClient] = createSignal(false);
onMount(() => {
setIsClient(true);
});
return <Show when={isClient()} fallback={props.fallback}>
{props.children}
</Show>;
}
export {
ClientOnly
};