import { useSignal } from "@preact/signals"; import { useEffect } from "preact/hooks"; import type { ComponentChildren } from "preact"; export interface JsxConditionalProps { jsx?: ComponentChildren; children?: ComponentChildren; } export function JsxConditional(props: JsxConditionalProps) { const active = useSignal(false); const sig = useSignal(0); useEffect(() => { active.value = true; }, []); return (

{sig}

{active.value ? props.jsx : null}
{active.value ? props.children : null}
); }