@samitouri / QOS-React-2 / commits / d5fd60f7e6

Remove findInstanceBlockingEvent unused parameters (#26534)

## Summary First three parameters of `findInstanceBlockingEvent` are unused since I think if we remove the unused parameters it makes it easier to know that which parameters is need by `findInstanceBlockingEvent`. ## How did you test this change? Existing tests.

Mohammad Ghorbani committed Apr 4, 2023 at 20:07 UTC d5fd60f7e663a5cee61636f8f2dd174efa0fb2f0
2 files changed +3 -22
packages/react-dom-bindings/src/events/ReactDOMEventListener.js
+2 -15
@@ -155,12 +155,7 @@ export function dispatchEvent(
155 return;
156 }
157
158 - let blockedOn = findInstanceBlockingEvent(
159 - domEventName,
160 - eventSystemFlags,
161 - targetContainer,
162 - nativeEvent,
163 - );
158 + let blockedOn = findInstanceBlockingEvent(nativeEvent);
159 if (blockedOn === null) {
160 dispatchEventForPluginEventSystem(
161 domEventName,
@@ -198,12 +193,7 @@ export function dispatchEvent(
193 if (fiber !== null) {
194 attemptSynchronousHydration(fiber);
195 }
201 - const nextBlockedOn = findInstanceBlockingEvent(
202 - domEventName,
203 - eventSystemFlags,
204 - targetContainer,
205 - nativeEvent,
206 - );
196 + const nextBlockedOn = findInstanceBlockingEvent(nativeEvent);
197 if (nextBlockedOn === null) {
198 dispatchEventForPluginEventSystem(
199 domEventName,
@@ -240,9 +230,6 @@ export let return_targetInst: null | Fiber = null;
230 // Returns a SuspenseInstance or Container if it's blocked.
231 // The return_targetInst field above is conceptually part of the return value.
232 export function findInstanceBlockingEvent(
243 - domEventName: DOMEventName,
244 - eventSystemFlags: EventSystemFlags,
245 - targetContainer: EventTarget,
233 nativeEvent: AnyNativeEvent,
234 ): null | Container | SuspenseInstance {
235 // TODO: Warn if _enabled is false.
packages/react-dom-bindings/src/events/ReactDOMEventReplaying.js
+1 -7
@@ -376,13 +376,7 @@ function attemptReplayContinuousQueuedEvent(
376 }
377 const targetContainers = queuedEvent.targetContainers;
378 while (targetContainers.length > 0) {
379 - const targetContainer = targetContainers[0];
380 - const nextBlockedOn = findInstanceBlockingEvent(
381 - queuedEvent.domEventName,
382 - queuedEvent.eventSystemFlags,
383 - targetContainer,
384 - queuedEvent.nativeEvent,
385 - );
379 + const nextBlockedOn = findInstanceBlockingEvent(queuedEvent.nativeEvent);
380 if (nextBlockedOn === null) {
381 const nativeEvent = queuedEvent.nativeEvent;
382 const nativeEventClone = new nativeEvent.constructor(