Skip to content

Commit

Permalink
Cache tags
Browse files Browse the repository at this point in the history
  • Loading branch information
sebmarkbage committed Sep 5, 2019
1 parent 38737b5 commit be7e4f9
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/react-dom/src/events/ReactDOMEventListener.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,8 @@ function handleTopLevel(bookKeeping: BookKeepingInstance) {
if (!root) {
break;
}
if (ancestor.tag === HostComponent || ancestor.tag === HostText) {
const tag = ancestor.tag;
if (tag === HostComponent || tag === HostText) {
bookKeeping.ancestors.push(ancestor);
}
ancestor = getClosestInstanceFromNode(root);
Expand Down Expand Up @@ -327,13 +328,14 @@ export function dispatchEvent(
// This tree has been unmounted already.
targetInst = null;
} else {
if (nearestMounted.tag === SuspenseComponent) {
const tag = nearestMounted.tag;
if (tag === SuspenseComponent) {
// TODO: This is a good opportunity to schedule a replay of
// the event instead once this boundary has been hydrated.
// For now we're going to just ignore this event as if it's
// not mounted.
targetInst = null;
} else if (nearestMounted.tag === HostRoot) {
} else if (tag === HostRoot) {
// We have not yet mounted/hydrated the first children.
// TODO: This is a good opportunity to schedule a replay of
// the event instead once this root has been hydrated.
Expand Down

0 comments on commit be7e4f9

Please sign in to comment.