Skip to content

Commit

Permalink
Convert invariant to warning
Browse files Browse the repository at this point in the history
  • Loading branch information
rickhanlonii committed Jan 27, 2021
1 parent 2c7a2eb commit 4b5c754
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion packages/react-reconciler/src/ReactFiberWorkLoop.new.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.',
Expand Down
3 changes: 2 additions & 1 deletion packages/react-reconciler/src/ReactFiberWorkLoop.old.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.',
Expand Down

0 comments on commit 4b5c754

Please sign in to comment.