Clear canceled task node early (#16403)

This commit is contained in:
Dan Abramov 2019-08-21 19:49:22 +01:00 committed by GitHub
parent 0672829053
commit 3ed289b3b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -160,7 +160,9 @@ export function cancelCallback(callbackNode: mixed) {
export function flushSyncCallbackQueue() {
if (immediateQueueCallbackNode !== null) {
Scheduler_cancelCallback(immediateQueueCallbackNode);
const node = immediateQueueCallbackNode;
immediateQueueCallbackNode = null;
Scheduler_cancelCallback(node);
}
flushSyncCallbackQueueImpl();
}