`useState` gives a component a piece of state and a setter. Calling the setter schedules a re-render with the new value; it never mutates the old value directly.
import { useState } from "react";
import { Pressable, Text } from "react-native";
function Counter() {
const [count, setCount] = useState(0);
return (
<Pressable onPress={() => setCount((c) => c + 1)}>
<Text>{count}</Text>
</Pressable>
);
}Prefer the updater-function form `setCount((c) => c + 1)` when the new value depends on the previous one — it avoids stale closures when several updates happen in quick succession.