use-uncontrolled
Manage state of both controlled and uncontrolled components
Import
Source
Docs
Package
Usage
use-uncontrolled allows you to manage state for both controlled and uncontrolled components:
In the example above rule
function is used to determine which value should be used initially:
Now you can use your component as controlled and uncontrolled input:
TypeScript
Set value type
By default, hook will set type automatically, but you can provide your own type: