babel-plugin-jsx icon indicating copy to clipboard operation
babel-plugin-jsx copied to clipboard

why the onInput is type 'Event' not 'InputEvent', can get e.target.value

Open HomyeeKing opened this issue 4 years ago • 6 comments

image

but when I switch to Event, I can't find e.target.value, how I can get the input value through the event image

HomyeeKing avatar Dec 17 '20 11:12 HomyeeKing

The most easier way to solve this problem is mark event to any.

Zcating avatar Dec 18 '20 02:12 Zcating

Not sure why. But you can type cast your (e.target as HTMLInputElement).value

vutran6853 avatar Dec 21 '20 07:12 vutran6853

@vutran6853 I think it's about babel-jsx, need to redefine the type of the origin input ?

HomyeeKing avatar Dec 21 '20 08:12 HomyeeKing

(e.target as HTMLInputElement).value

Amour1688 avatar Dec 21 '20 13:12 Amour1688

@Amour1688 Why is this issue closed? Yes, that is a solution, but that is not expected behavior. How hard would it be to fix this?

jsbroks avatar Feb 10 '21 06:02 jsbroks

plus one for reopening this issue...

sainf avatar May 07 '21 21:05 sainf