From 14db1d7a11ab49add5a3ac2e635db833a88f3915 Mon Sep 17 00:00:00 2001 From: Sebastian Markbage Date: Wed, 4 Sep 2019 17:34:03 -0700 Subject: [PATCH] Add todo 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. --- packages/react-dom/src/events/ReactDOMEventListener.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/react-dom/src/events/ReactDOMEventListener.js b/packages/react-dom/src/events/ReactDOMEventListener.js index e6478fecf811..7a00158e8858 100644 --- a/packages/react-dom/src/events/ReactDOMEventListener.js +++ b/packages/react-dom/src/events/ReactDOMEventListener.js @@ -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