Merge pull request #194 from Shinyaigeek/fix/hooks-useInput-type

fix: type of useInput
This commit is contained in:
witt
2020-05-10 16:38:44 +08:00
committed by GitHub

View File

@@ -10,7 +10,7 @@ const useInput = (
reset: () => void
bindings: {
value: string
onChange: (event: React.ChangeEvent<HTMLInputElement>) => void
onChange: (event: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => void
}
} => {
const [state, setState, currentRef] = useCurrentState<string>(initialValue)
@@ -22,7 +22,7 @@ const useInput = (
reset: () => setState(initialValue),
bindings: {
value: state,
onChange: (event: React.ChangeEvent<HTMLInputElement>) => {
onChange: (event: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {
setState(event.target.value)
},
},