MatchProps
Props of Match: the condition, and what it shows while it holds.
Utilisation
Select one of several states
Ce type est utilisé par 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>
);
}Déclaration du type
export interface MatchProps<T> extends ElementAttributes {
when: When<T>;
children?: BranchChildren<T>;
}Membres 3
| Nom | Type | Requis | Description |
|---|---|---|---|
when | When<T> | Oui | — |
children | BranchChildren<T> | Non | — |
key | string | number | Non | — |
Généré depuis les déclarations TypeScript publiques : signatures, props et valeurs par défaut viennent de la source vérifiée, les descriptions de sa JSDoc. Aucune valeur par défaut n'est inventée.