react input event typescript code example
Example 1: typescript react input type
onChange={(
ev: React.ChangeEvent<HTMLInputElement>,
): void => setInputValue(ev.target.value)}
Example 2: react event typescript
handleChange(e: React.ChangeEvent<HTMLInputElement>) {
this.setState({temperature: e.target.value});
}
render() {
...
<input value={temperature} onChange={this.handleChange} />
...
);
}
Example 3: e typescript
update = (e: React.ChangeEvent<HTMLInputElement>): void => {
this.props.login[e.currentTarget.name] = e.currentTarget.value
}
Example 4: React Typescript form event
handleSubmit(eventL FormEvent<HTMLFormElement>) {
}