ContextMenuEvent
The item the user selected, by its value.
Verwendung
Offer actions for an episode
import { ContextMenu, Text, VStack } from 'kuito';
const ITEMS = [
{ value: 'share', label: 'Share' },
{ value: 'played', label: 'Mark played' },
{ value: 'delete', label: 'Delete', destructive: true },
];
export default function Episode() {
return (
<ContextMenu title="Episode 4" items={ITEMS} onSelect={(event) => console.log(event.value)}>
<VStack padding={12}>
<Text>Episode 4</Text>
</VStack>
</ContextMenu>
);
}Typdeklaration
export type ContextMenuEvent = NativeViewEvent<'select', { value: string }>;Mitglieder 4
| Name | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
type | "select" | Ja | — |
target | unknown | Ja | — |
isTrusted | boolean | Ja | — |
value | string | Ja | — |
Generiert aus den öffentlichen TypeScript-Deklarationen: Signaturen, Props und Standardwerte stammen aus der geprüften Quelle, Beschreibungen aus deren JSDoc. Kein Standardwert ist erfunden.