From 4b5c754229fc79ec1be1a59703711bf51807d2ce Mon Sep 17 00:00:00 2001 From: Rick Hanlon Date: Wed, 27 Jan 2021 15:32:46 -0700 Subject: [PATCH] Convert invariant to warning --- packages/react-reconciler/src/ReactFiberWorkLoop.new.js | 3 ++- packages/react-reconciler/src/ReactFiberWorkLoop.old.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/react-reconciler/src/ReactFiberWorkLoop.new.js b/packages/react-reconciler/src/ReactFiberWorkLoop.new.js index 819ad34778d05..bcd140a859c60 100644 --- a/packages/react-reconciler/src/ReactFiberWorkLoop.new.js +++ b/packages/react-reconciler/src/ReactFiberWorkLoop.new.js @@ -728,7 +728,8 @@ function ensureRootIsScheduled(root: FiberRoot, currentTime: number) { if (__DEV__) { // If we're going to re-use an existing task, it needs to exist. // Assume that discrete update microtasks are non-cancellable and null. - invariant( + // TODO: Temporary until we confirm this warning is not fired. + console['error']( existingCallbackNode != null || newCallbackPriority === InputDiscreteLanePriority, 'Expected scheduled callback to exist. This error is likely caused by a bug in React. Please file an issue.', diff --git a/packages/react-reconciler/src/ReactFiberWorkLoop.old.js b/packages/react-reconciler/src/ReactFiberWorkLoop.old.js index fee9868c0fe48..b68b3928a1f46 100644 --- a/packages/react-reconciler/src/ReactFiberWorkLoop.old.js +++ b/packages/react-reconciler/src/ReactFiberWorkLoop.old.js @@ -710,7 +710,8 @@ function ensureRootIsScheduled(root: FiberRoot, currentTime: number) { if (__DEV__) { // If we're going to re-use an existing task, it needs to exist. // Assume that discrete update microtasks are non-cancellable and null. - invariant( + // TODO: Temporary until we confirm this warning is not fired. + console['error']( existingCallbackNode != null || newCallbackPriority === InputDiscreteLanePriority, 'Expected scheduled callback to exist. This error is likely caused by a bug in React. Please file an issue.',