Better JSX types for form events #4098
Labels
has workaround
A workaround has been found to avoid the problem
scope: types
✨ feature request
New feature or request
What problem does this feature solve?
Currently the JSX types specify that native input event handlers receive an
Event
: https://github.com/vuejs/vue-next/blob/8ed3ed6c27b0fb9a1b6994eddc967e42d4b3d4e1/packages/runtime-dom/types/jsx.d.ts#L1210This is very general compared to the runtime type. As an example,
@input
on an input element will actually give you anInputEvent
. It would be useful if the correct event type could be inferred so that we don't have to cast the event object. I assume it's not as simple as e.g. replacingEvent
withInputEvent
foronInput
or it would probably have been done already, but is this something that could potentially be solved?What does the proposed API look like?
N/A, just a type improvement, not an API
The text was updated successfully, but these errors were encountered: