-
Notifications
You must be signed in to change notification settings - Fork 1k
[@labs/react] type event callbacks #2648
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
Conversation
🦋 Changeset detectedLatest commit: cd0934c The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
📊 Tachometer Benchmark ResultsSummarynop-update
render
update
update-reflect
Resultslit-element-list
render
update
update-reflect
lit-html-kitchen-sink
render
update
nop-update
lit-html-repeat
render
update
lit-html-template-heavy
render
update
reactive-element-list
render
update
update-reflect
|
justinfagnani
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks really good @taylor-vann !
Just some naming suggestions and a typing simplification.
taylor-vann
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes addressed :)
taylor-vann
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addressed changes :)
justinfagnani
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome!
|
Thanks @justinfagnani @WickyNilliams @sorvell for helping me get this across the finish line |
|
Really nice how small this change was in the end! Thanks for this, very much appreciated |
|
No rush, but i'm curious what the plan/schedule is for releasing this? Thanks again! |
|
@WickyNilliams sorry for the delay but this change has made it to the release in the version mentioned above :) |
|
Awesome thanks! |
This PR is a retcon of PR #2445
(e: Event) => void{propName: EventType, ...}{prop: (e: EventType) => void, ...}in the React Component Props{'onChange': Event}will eclipseReact.FormEvent<HTMLInputElement>with a DOMEventThis should allow clients to explicitly define event types in react event callbacks like the example below:
Without generics, the typing defaults to
Event:Undefined, 'missing', or types that don't extend from
Eventalso default toEventin the EventMap: