-
Notifications
You must be signed in to change notification settings - Fork 47.2k
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
ReactDOM.useEvent: revert and add guard for null stateNode #18441
Conversation
This reverts commit 90e90ac.
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit dc6518e:
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 2d01aae:
|
Details of bundled changes.Comparing: 90e90ac...2d01aae react-dom
react-art
react-test-renderer
ReactDOM: size: 0.0%, gzip: -0.0% Size changes (stable) |
Thanks. Could you go through all code behind useEvent flag to search for similar bugs? |
@gaearon I deep a deep dive earlier today, I couldn't see anywhere else we access |
dee7c8e
to
6d5e3ad
Compare
Add accumulateUseEventListeners flag Fix Fxi Add support for HostText being target Fix Remove last part Fix Fix
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.
lgtmbbq
This PR reverts the revert PR (#18438) and applies the appropiate fix. The previous problem was that we were trying to call
getListenersFromTarget
on theinstance
, which was taken fromnode.stateNode
. I missed the case where thestateNode
can benull
(when the component gets unmounted), so we should make sure to check that the instance is notnull
. I also added some validation to ensure thatlastHostComponent
should never benull
too, as per comments from @gaearon in #18375.