State & events
useState and useMemo work the way you expect from React, but Kog has no
virtual DOM and no re-render. Each state change runs only the fine-grained
effects that read that value, and each calls exactly one native setter. In the
counter below, tapping +1 updates just the one label that reads count,
nothing else.
onPress is a plain closure that always sees current state, with no
dependency arrays and no stale captures.
Tap +1 and -1 in the simulator. This is the shipped examples/counter
app, running on the same runtime it uses on a real board. It's imported here
at build time, not copied.
Next: lists →