Files
sweet/tests/fixture_island_nesting/islands/IslandConditional.tsx
T

18 lines
397 B
TypeScript

import { Signal } from "@preact/signals";
import { ComponentChildren } from "preact";
export interface IslandConditionalProps {
show: Signal<boolean>;
children?: ComponentChildren;
}
export default function IslandConditional(
{ show, children }: IslandConditionalProps,
) {
return (
<div class="island">
{show.value ? <p>island content</p> : <>{children}</>}
</div>
);
}