Created
October 23, 2022 07:18
-
-
Save koss-lebedev/84c52256f8496f8224af2a746cc1c938 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Props = HTMLAttributes<HTMLInputElement> & { | |
onUpdate: (value: string) => void | |
} | |
const CustomInput = ({ onUpdate, ...props }: Props) => { | |
const onChange = (event) => { | |
/// ... some logic | |
onUpdate(event.target.value) | |
} | |
return <input {...props} onChange={onChange} /> | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment