mirror of
https://github.com/zebrajr/react.git
synced 2025-12-06 12:20:20 +01:00
* [Scheduler] requestPaint Signals to Scheduler that the browser needs to paint the screen. React will call it in the commit phase. Scheduler will yield at the end of the current frame, even if there is no pending input. When `isInputPending` is not available, this has no effect, because we yield at the end of every frame regardless. React will call `requestPaint` in the commit phase as long as there's at least one effect. We could choose not to call it if none of the effects are DOM mutations, but this is so rare that it doesn't seem worthwhile to bother checking. * Fall back gracefully if requestPaint is missing
58 lines
1.4 KiB
JavaScript
58 lines
1.4 KiB
JavaScript
/**
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*
|
|
* @flow
|
|
*/
|
|
|
|
import React from 'react';
|
|
|
|
const ReactInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
|
|
const {
|
|
unstable_cancelCallback,
|
|
unstable_now,
|
|
unstable_scheduleCallback,
|
|
unstable_shouldYield,
|
|
unstable_requestPaint,
|
|
unstable_getFirstCallbackNode,
|
|
unstable_runWithPriority,
|
|
unstable_next,
|
|
unstable_continueExecution,
|
|
unstable_pauseExecution,
|
|
unstable_getCurrentPriorityLevel,
|
|
unstable_ImmediatePriority,
|
|
unstable_UserBlockingPriority,
|
|
unstable_NormalPriority,
|
|
unstable_LowPriority,
|
|
unstable_IdlePriority,
|
|
unstable_forceFrameRate,
|
|
|
|
// this doesn't actually exist on the scheduler, but it *does*
|
|
// on scheduler/unstable_mock, which we'll need inside act().
|
|
unstable_flushWithoutYielding,
|
|
} = ReactInternals.Scheduler;
|
|
|
|
export {
|
|
unstable_cancelCallback,
|
|
unstable_now,
|
|
unstable_scheduleCallback,
|
|
unstable_shouldYield,
|
|
unstable_requestPaint,
|
|
unstable_getFirstCallbackNode,
|
|
unstable_runWithPriority,
|
|
unstable_next,
|
|
unstable_continueExecution,
|
|
unstable_pauseExecution,
|
|
unstable_getCurrentPriorityLevel,
|
|
unstable_ImmediatePriority,
|
|
unstable_UserBlockingPriority,
|
|
unstable_NormalPriority,
|
|
unstable_LowPriority,
|
|
unstable_IdlePriority,
|
|
unstable_forceFrameRate,
|
|
unstable_flushWithoutYielding,
|
|
};
|