use-validated-state
Manages state with validation
Source
Docs
PackageIcon
Usage
The use-validated-state hook validates state with a given rule each time the state is set.
It returns an object with the current validation state, last valid value, and current value:
Example
Current value: [empty string]
Last valid value: [empty string]
Definition
Exported types
The UseValidatedStateValue and UseValidatedStateReturnValue types are exported from @mantine/hooks;