Skip to content

Commit

Permalink
fix(flushMicroTasks): fallback to no scheduler (#739)
Browse files Browse the repository at this point in the history
Co-authored-by: Kent C. Dodds <[email protected]>
  • Loading branch information
MatanBobi and kentcdodds authored Jul 8, 2020
1 parent b81fd01 commit 9e5cf59
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/flush-microtasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 9e5cf59

Please sign in to comment.