Skip to content

Commit 3ed289b

Browse files
authored
Clear canceled task node early (#16403)
1 parent 0672829 commit 3ed289b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/react-reconciler/src/SchedulerWithReactIntegration.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,9 @@ export function cancelCallback(callbackNode: mixed) {
160160

161161
export function flushSyncCallbackQueue() {
162162
if (immediateQueueCallbackNode !== null) {
163-
Scheduler_cancelCallback(immediateQueueCallbackNode);
163+
const node = immediateQueueCallbackNode;
164+
immediateQueueCallbackNode = null;
165+
Scheduler_cancelCallback(node);
164166
}
165167
flushSyncCallbackQueueImpl();
166168
}

0 commit comments

Comments
 (0)