[Scheduler] Fix navigator.isInputPending call
Must be called as a method.
Andrew Clark committed
Jun 22, 2019 at 00:50 UTC
595c9414ba1097eceaab8323de35075507f64fac
1 file changed
+2
-2
packages/scheduler/src/forks/SchedulerHostConfig.default.js
+2
-2
@@ -174,7 +174,7 @@ if (
174
navigator.scheduling !== undefined &&
175
navigator.scheduling.isInputPending !== undefined
176
) {
177
- const isInputPending = navigator.scheduling.isInputPending;
177
+ const scheduling = navigator.scheduling;
178
shouldYieldToHost = function() {
179
const currentTime = getCurrentTime();
180
if (currentTime >= frameDeadline) {
@@ -186,7 +186,7 @@ if (
186
// yield regardless, since there could be a pending paint that wasn't
187
// accompanied by a call to `requestPaint`, or other main thread tasks
188
// like network events.
189
- if (needsPaint || isInputPending()) {
189
+ if (needsPaint || scheduling.isInputPending()) {
190
// There is either a pending paint or a pending input.
191
return true;
192
}