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