Form Reset
Keeps custom controls aligned with native form reset semantics without reporting uncontrolled resets as user changes.
Installation
dgadd is not public on npm yet. Until the first release, pack @diffgazer/add from the repository and install that tarball into this app, which is what puts dgadd on pnpm exec.
The hosted registry is not public yet because r.b4r7.dev does not resolve. Use this source checkout or a local registry preview until the endpoint returns 200.
Diffgazer packages are not yet published to npm. Until the first release, pack @diffgazer/ui and @diffgazer/keys from the repository and install those tarballs.
UI components require Tailwind CSS v4. Local copy mode imports src/styles/styles.css; package mode uses @diffgazer/ui CSS once packages are available.
Parameters
Returns
Examples
Resettable Input
Notes
Uncontrolled custom controls
Pair this hook with useControllableState's resetValue setter. It restores the default internal value without calling the public onChange callback.
Latest reset value
The reset listener stays stable while reading the latest resetValue and onReset callback.
Last mutation wins
Call the returned invalidation function immediately before changing the control value so an older queued reset cannot overwrite the newer mutation.
Source
Highlighted source loads after this disclosure opens. Browse the source repository.