MatchProps
Props of Match: the condition, and what it shows while it holds.
Verwendung
Select one of several states
Dieser Typ wird verwendet von Match
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
export interface MatchProps<T> extends ElementAttributes {
when: When<T>;
children?: BranchChildren<T>;
}Mitglieder 3
| Name | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
when | When<T> | Ja | — |
children | BranchChildren<T> | Nein | — |
key | string | number | Nein | — |
Generiert aus den öffentlichen TypeScript-Deklarationen: Signaturen, Props und Standardwerte stammen aus der geprüften Quelle, Beschreibungen aus deren JSDoc. Kein Standardwert ist erfunden.