react change event typescript code example
Example 1: typescript react onchange event type
type Props = {
onChange: (e: React.ChangeEvent<HTMLInputElement>) => void
}
export Input:React.FC<Props> ({onChange}) => (
<input type="tex" onChange={onChange} />
)
Example 2: typescript react input type
onChange={(
ev: React.ChangeEvent<HTMLInputElement>,
): void => setInputValue(ev.target.value)}