Verwendung

Select one of several states

Dieser Typ wird verwendet von Match

tsx
import { Match, Switch, Text, signal } from 'kuito';

export function Status() {
  const state = signal<'loading' | 'offline' | 'ready'>('loading');
  return (
    <Switch fallback={<Text>Ready</Text>}>
      <Match when={state.value === 'loading'}>
        <Text>Loading…</Text>
      </Match>
      <Match when={state.value === 'offline'}>
        <Text>Check your connection</Text>
      </Match>
    </Switch>
  );
}

Typdeklaration

ts
export type BranchChildren<T> = KuitoNode | ((value: Truthy<T>) => KuitoNode);

Typ

ts
KuitoNode | ((value: Truthy<T>) => KuitoNode)
Generiert aus den öffentlichen TypeScript-Deklarationen: Signaturen, Props und Standardwerte stammen aus der geprüften Quelle, Beschreibungen aus deren JSDoc. Kein Standardwert ist erfunden.