Last active
April 22, 2021 19:02
-
-
Save joelbarbosa/aff6273b56add20ebd7063af243cbc9b to your computer and use it in GitHub Desktop.
type EventTarget with typescript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type EventTarget<T> = EventTarget & T; | |
interface FormEvent<T> extends Event { | |
target: EventTarget<T>; | |
} | |
function handleSubmit(event: FormEvent<{price: number}>) { | |
event.target.price; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment