Skip to content
Permalink
Browse files

fix(flushMicroTasks): fallback to no scheduler (#739)

Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
  • Loading branch information
MatanBobi and kentcdodds committed Jul 8, 2020
1 parent b81fd01 commit 9e5cf59ceaa66b534ef95d519cacb8afc4814215
Showing with 5 additions and 3 deletions.
  1. +5 −3 src/flush-microtasks.js
@@ -20,9 +20,6 @@ function getIsUsingFakeTimers() {

const globalObj = typeof window === 'undefined' ? global : window
let Scheduler = globalObj.Scheduler
const isModernScheduleCallbackSupported = satisfies(React.version, '>16.8.6', {
includePrerelease: true,
})

let didWarnAboutMessageChannel = false
let enqueueTask
@@ -58,9 +55,14 @@ try {
'if you encounter this warning.',
)
}

}
}

const isModernScheduleCallbackSupported = Scheduler && satisfies(React.version, '>16.8.6', {
includePrerelease: true,
})

function scheduleCallback(cb) {
const NormalPriority = Scheduler
? Scheduler.NormalPriority || Scheduler.unstable_NormalPriority

0 comments on commit 9e5cf59

Please sign in to comment.
You can’t perform that action at this time.