Skip to content

Commit

Permalink
Add todo
Browse files Browse the repository at this point in the history
The approach of checking isFiberMounted answers if we might be in an
in-progress hydration but it doesn't answer which root or boundary
might be in-progress so we don't know what to wait for.

This needs some refactoring.
  • Loading branch information
sebmarkbage committed Sep 5, 2019
1 parent 5a28397 commit 14db1d7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/react-dom/src/events/ReactDOMEventListener.js
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,11 @@ export function dispatchEvent(
targetInst = null;
}
} else {
// TODO: If the nearest match was not mounted because it's part
// an in-progress hydration, this would be a good time schedule
// a replay of the event. However, we don't have easy access to
// the HostRoot or SuspenseComponent here.

// If we get an event (ex: img onload) before committing that
// component's mount, ignore it for now (that is, treat it as if it was an
// event on a non-React tree). We might also consider queueing events and
Expand Down

0 comments on commit 14db1d7

Please sign in to comment.