-
Notifications
You must be signed in to change notification settings - Fork 47.8k
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
Move MouseWheel event type detection to BrowserEventConstants #11585
Comments
Marked this as a good first issue. The event system can be a beast. I'd be happy to walk through it with an interested contributor. |
Hello @nhunzaker I'd like to work on this issue. Any other files you suggest looking at other than the two that you have linked? |
Totally! If you were curious: The main consumer of Most events are delegated to the document for the related DOM element. So ReactDOMFiberComponent uses an internal function that finds that document before requesting an event to be subscribed.
From there, the Emitter enumerates through all of the event types that need to be attached and says "Have I already attached this? If not: start listening!". That gets to the change I'm suggesting. This function is doing some aliasing of event names for different browsers that I think shouldn't happen at this phase. We can normalize |
Fixed by #11594. Thanks @cristidrg! |
I think we can move the
wheel
event support check in BrowserEventEmitter into BrowserEventConstantsThat runs the check once, which is nice for wheel and scroll events, which eventually need to be attached locally.
Filing this for myself as a part of #11550. But this could happen on master right now.
More or less, I'm interested in cutting the overhead of event listening as much as possible, and this is really low hanging 🥝.
The text was updated successfully, but these errors were encountered: