mirror of
https://github.com/zhigang1992/react.git
synced 2026-03-26 22:42:51 +08:00
fix: type of useInput
This commit is contained in:
@@ -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)
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user