react-hooks
react-hooks copied to clipboard
feat(input-value): make useInputValue more compatible
Inspired by https://github.com/react-component/field-form/blob/master/src/utils/valueUtil.ts#L120
I love this feature, and useInputValue
can be generic (default to string
) since custom components may provide value
and onChange
in custom types, and strings can also be literal unions for checkbox and radio
You are right, with generic is better.
This is a breaking change since initialValue
no longer defaults to empty string, I need some more time to think about it