SolidJSS
SolidJSโ€ข3y agoโ€ข
6 replies
Samual ๐Ÿฆข

`ClientOnly` fallback

I found this code for a client that only runs on the client
function ClientOnly(props: { children: JSX.Element }) {
    const [ getRender, setRender ] = createSignal()
    onMount(() => setRender(() => props.children))
    return getRender as any as JSX.Element
}
but how can I get it to render a fallback?
Was this page helpful?