use-validated-state
Manages state with validation
Source
Docs
Package
Usage
use-validated-state
validates state with a given rule each time state is set.
It returns an object with current validation state, last valid value and current value:
Example
Current value: [empty string]
Last valid value: [empty string]
Definition
Exported types
UseValidatedStateValue
and UseValidatedStateReturnValue
types are exported from @mantine/hooks
package,
you can import them in your application: