Skip to content

docs: Switch TS Events docs to use .currentTarget#1241

Merged
rschristian merged 1 commit intomasterfrom
docs/ts-events
Feb 18, 2025
Merged

docs: Switch TS Events docs to use .currentTarget#1241
rschristian merged 1 commit intomasterfrom
docs/ts-events

Conversation

@rschristian
Copy link
Member

Something that's popped up a few times in the last few days, we should generally point users to .currentTarget now that our types will infer the correct element automatically when possible. Impossible to avoid casting with .target which is a bit cumbersome.

Not sure if we should explicitly state why .currentTarget should be preferred over .target, or at least, I'm not sure how to phrase that beyond "React does weird things with their events".

@rschristian rschristian merged commit ea81e1d into master Feb 18, 2025
5 checks passed
@rschristian rschristian deleted the docs/ts-events branch February 18, 2025 06:14
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

Successfully merging this pull request may close these issues.

2 participants