Hooks & Utilities
v1.0.0Added in 1.0.0
A state hook that is controlled when you pass a value and keeps its own state when you do not.
Both steppers run on the same hook. The first keeps its own count. The second is controlled by its parent, which caps it at 5 and can reset it, so you can see who owns the value.
npx wingo-ui@latest add use-controllable-stateNo dependencies beyond React.
defaultValue={2}value={quantity}The parent caps it at 5