property 'name' does not exist on type 'eventtarget' react
// If you have to use event.target itself, you would have to cast the object:
const { name } = event.target as HTMLButtonElement;
property 'name' does not exist on type 'eventtarget' react
// If you have to use event.target itself, you would have to cast the object:
const { name } = event.target as HTMLButtonElement;
REACT TS roperty 'value' does not exist on type 'EventTarget & Element'
@Zyon Lyod has already provided the code and some explanation but i will add
more details:
The problem is that not all html events have the value property. And thus not all
event.target have that property since event.target is a generic html element
so you need to cast to the html element that you are using
You are welcome,
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us