Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
HomyeeKing opened this issue Dec 17, 2020 · 6 comments
Open

Comments

@HomyeeKing
Copy link

HomyeeKing commented Dec 17, 2020

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

@Zcating
Copy link

Zcating commented Dec 18, 2020

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

@vutran6853
Copy link

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

@HomyeeKing
Copy link
Author

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

@Amour1688
Copy link
Member

(e.target as HTMLInputElement).value

@jsbroks
Copy link

jsbroks commented Feb 10, 2021

@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?

@sainf
Copy link

sainf commented May 7, 2021

plus one for reopening this issue...

@Amour1688 Amour1688 reopened this May 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants