Skip to content

Instantly share code, notes, and snippets.

@koss-lebedev
Created October 23, 2022 07:18
Show Gist options
  • Save koss-lebedev/84c52256f8496f8224af2a746cc1c938 to your computer and use it in GitHub Desktop.
Save koss-lebedev/84c52256f8496f8224af2a746cc1c938 to your computer and use it in GitHub Desktop.
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