mirror of
https://github.com/zhigang1992/react.git
synced 2026-04-29 04:35:32 +08:00
fix: type of useInput
This commit is contained in:
@@ -10,7 +10,7 @@ const useInput = (
|
|||||||
reset: () => void
|
reset: () => void
|
||||||
bindings: {
|
bindings: {
|
||||||
value: string
|
value: string
|
||||||
onChange: (event: React.ChangeEvent<HTMLInputElement>) => void
|
onChange: (event: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => void
|
||||||
}
|
}
|
||||||
} => {
|
} => {
|
||||||
const [state, setState, currentRef] = useCurrentState<string>(initialValue)
|
const [state, setState, currentRef] = useCurrentState<string>(initialValue)
|
||||||
@@ -22,7 +22,7 @@ const useInput = (
|
|||||||
reset: () => setState(initialValue),
|
reset: () => setState(initialValue),
|
||||||
bindings: {
|
bindings: {
|
||||||
value: state,
|
value: state,
|
||||||
onChange: (event: React.ChangeEvent<HTMLInputElement>) => {
|
onChange: (event: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {
|
||||||
setState(event.target.value)
|
setState(event.target.value)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user