Why is this wrong?
<input
id="url"
type="text" className="form-control"
value={url}
placeholder="https://example.com"
onChange={(e: React.FormEvent<HTMLInputElement>) => this.setState({
url: e.target.value
})}
/>
I'm getting: Property 'value' does not exist on type 'EventTarget'
Note: There is nothing wrong with the code e.target.value
. That does return the correct value. My question is what is the proper "type" for this event, because React.FormEvent<HTMLInputElement>
does not have the property event.target.value
.