Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/renderers/dom/client/ReactEventListener.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ var ReactUpdates = require('ReactUpdates');
var assign = require('Object.assign');
var getEventTarget = require('getEventTarget');
var getUnboundedScrollPosition = require('getUnboundedScrollPosition');
var invariant = require('invariant');

var DOCUMENT_FRAGMENT_NODE_TYPE = 11;

Expand Down Expand Up @@ -128,6 +129,12 @@ function handleTopLevelWithPath(bookKeeping) {
// Jump to the root of this React render tree
while (currentPathElementID !== newRootID) {
i++;
invariant(
i < path.length,
'Expected to find another React root ' +
'before reaching end of event path (%s).',
path
);
currentPathElement = path[i];
currentPathElementID = ReactMount.getID(currentPathElement);
}
Expand Down