We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9d4a805 commit 04f070fCopy full SHA for 04f070f
src/renderers/dom/client/ReactEventListener.js
@@ -22,6 +22,7 @@ var ReactUpdates = require('ReactUpdates');
22
var assign = require('Object.assign');
23
var getEventTarget = require('getEventTarget');
24
var getUnboundedScrollPosition = require('getUnboundedScrollPosition');
25
+var invariant = require('invariant');
26
27
var DOCUMENT_FRAGMENT_NODE_TYPE = 11;
28
@@ -128,6 +129,12 @@ function handleTopLevelWithPath(bookKeeping) {
128
129
// Jump to the root of this React render tree
130
while (currentPathElementID !== newRootID) {
131
i++;
132
+ invariant(
133
+ i < path.length,
134
+ 'Expected to find another React root ' +
135
+ 'before reaching end of event path (%s).',
136
+ path
137
+ );
138
currentPathElement = path[i];
139
currentPathElementID = ReactMount.getID(currentPathElement);
140
}
0 commit comments