-
Notifications
You must be signed in to change notification settings - Fork 46.9k
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
Warn early if event listener is not a function #10407
Comments
I'll take this one 😀 |
You got it! |
@gaearon so it looks like Fiber will throw the same error, but it does so lazily. Once you try to click the element it will trigger that invariant. The invariant currently lives in |
I would prefer that. |
It's worth double checking with @sebmarkbage if this was intentional. |
This was indeed intentional. We could warn early, but not throw. Because we should be able to lazily deal with event listeners by only looking at the properties when an event is triggered. Currently we loop over them all but this is an optimizable path. |
Warning early sounds sensible then. |
Hi - just wondering what the status is on this. |
We used to throw if event listener is not a function in Stack:
Fiber silently ignores this.
I think we should throw. This would let us add support for objects (e.g. for passive listener configuration) if we want to in a minor rather than a major.
The text was updated successfully, but these errors were encountered: