Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update src/flush-microtasks.js
  • Loading branch information
kentcdodds authored Jul 8, 2020
commit aa355092573b3d5c20306dbf53dc13831239f80f
14 changes: 4 additions & 10 deletions src/flush-microtasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,19 +59,13 @@ try {
)
}

if (isModernScheduleCallbackSupported) {
// eslint-disable-next-line no-console
console.error(
'This environment does not support module requiring, so we cannot require the Scheduler. ' +
'To fix this you can require the Scheduler in your test setup file.',
)

// Fallback to no scheduleCallback Supported.
isModernScheduleCallbackSupported = false
}
}
}

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

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