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:
@@ -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