mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Don't try to get the target node for responder if there is no listener
This can happen in edge cases where he listeners are already unmounted or not mounted yet or something.
This commit is contained in:
1 parent
064092102d
commit
22a8f9964e
1 file changed
+1
-1
@@ -204,7 +204,7 @@ function executeDirectDispatch(event) {
|
||||
!Array.isArray(dispatchListener),
|
||||
'executeDirectDispatch(...): Invalid `event`.'
|
||||
);
|
||||
event.currentTarget = EventPluginUtils.getNodeFromInstance(dispatchInstance);
|
||||
event.currentTarget = dispatchListener ? EventPluginUtils.getNodeFromInstance(dispatchInstance) : null;
|
||||
var res = dispatchListener ? dispatchListener(event) : null;
|
||||
event.currentTarget = null;
|
||||
event._dispatchListeners = null;
|
||||
|
||||
Reference in new issue
Block a user