Skip to content

How to: handle press/change events

You need to react to a native event (a tap, a value change), and the public shape of that event differs by framework.

Callback props — the classic imperative style.

<Pressable onPress={() => setCount(count + 1)} />
<Switch value={enabled} onValueChange={setEnabled} />
<TextInput value={name} onValueChange={setName} />

TextInput’s React/Vue/Svelte callback merges what used to be two native callbacks into one onValueChange(text, event) — an EventEmitter can’t carry two values, so Angular keeps (valueChange) text-only and adds a separate (change) output for the raw event.

For the full event-naming table and why a given event became a Vue emit vs stayed a raw passthrough listener, see the Events guide and the Components API.