diff --git a/packages/react-dom-bindings/src/events/ReactDOMEventListener.js b/packages/react-dom-bindings/src/events/ReactDOMEventListener.js index ab814b1b9053a..d10e8fccfbece 100644 --- a/packages/react-dom-bindings/src/events/ReactDOMEventListener.js +++ b/packages/react-dom-bindings/src/events/ReactDOMEventListener.js @@ -57,7 +57,7 @@ import {isRootDehydrated} from 'react-reconciler/src/ReactFiberShellHydration'; const {ReactCurrentBatchConfig} = ReactSharedInternals; // TODO: can we stop exporting these? -export let _enabled: boolean = true; +let _enabled: boolean = true; // This is exported in FB builds for use by legacy FB layer infra. // We'd like to remove this but it's not clear if this is safe. diff --git a/packages/react-dom-bindings/src/events/ReactDOMEventReplaying.js b/packages/react-dom-bindings/src/events/ReactDOMEventReplaying.js index b6464749ab861..48c9884c42878 100644 --- a/packages/react-dom-bindings/src/events/ReactDOMEventReplaying.js +++ b/packages/react-dom-bindings/src/events/ReactDOMEventReplaying.js @@ -60,11 +60,6 @@ type QueuedReplayableEvent = { let hasScheduledReplayAttempt = false; -// The queue of discrete events to be replayed. -const queuedDiscreteEvents: Array = []; - -// Indicates if any continuous event targets are non-null for early bailout. -const hasAnyQueuedContinuousEvents: boolean = false; // The last of each continuous event type. We only need to replay the last one // if the last target was dehydrated. let queuedFocus: null | QueuedReplayableEvent = null; @@ -82,14 +77,6 @@ type QueuedHydrationTarget = { }; const queuedExplicitHydrationTargets: Array = []; -export function hasQueuedDiscreteEvents(): boolean { - return queuedDiscreteEvents.length > 0; -} - -export function hasQueuedContinuousEvents(): boolean { - return hasAnyQueuedContinuousEvents; -} - const discreteReplayableEvents: Array = [ 'mousedown', 'mouseup', @@ -446,21 +433,6 @@ function scheduleCallbackIfUnblocked( export function retryIfBlockedOn( unblocked: Container | SuspenseInstance, ): void { - // Mark anything that was blocked on this as no longer blocked - // and eligible for a replay. - if (queuedDiscreteEvents.length > 0) { - scheduleCallbackIfUnblocked(queuedDiscreteEvents[0], unblocked); - // This is a exponential search for each boundary that commits. I think it's - // worth it because we expect very few discrete events to queue up and once - // we are actually fully unblocked it will be fast to replay them. - for (let i = 1; i < queuedDiscreteEvents.length; i++) { - const queuedEvent = queuedDiscreteEvents[i]; - if (queuedEvent.blockedOn === unblocked) { - queuedEvent.blockedOn = null; - } - } - } - if (queuedFocus !== null) { scheduleCallbackIfUnblocked(queuedFocus, unblocked); }