MatchProps
Props of Match: the condition, and what it shows while it holds.
Utilização
Select one of several states
Este tipo é usado por 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>
);
}Declaração do tipo
export interface MatchProps<T> extends ElementAttributes {
when: When<T>;
children?: BranchChildren<T>;
}Membros 3
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
when | When<T> | Sim | — |
children | BranchChildren<T> | Não | — |
key | string | number | Não | — |
Gerado a partir das declarações TypeScript públicas: assinaturas, props e predefinições vêm da fonte verificada, as descrições da sua JSDoc. Nenhuma predefinição é inventada.