(fiber, expirationTime)
| 24856 | return expirationTime; |
| 24857 | } |
| 24858 | function scheduleUpdateOnFiber(fiber, expirationTime) { |
| 24859 | checkForNestedUpdates(); |
| 24860 | warnAboutRenderPhaseUpdatesInDEV(fiber); |
| 24861 | var root = markUpdateTimeFromFiberToRoot(fiber, expirationTime); |
| 24862 | |
| 24863 | if (root === null) { |
| 24864 | warnAboutUpdateOnUnmountedFiberInDEV(fiber); |
| 24865 | return; |
| 24866 | } |
| 24867 | |
| 24868 | checkForInterruption(fiber, expirationTime); |
| 24869 | recordScheduleUpdate(); // TODO: computeExpirationForFiber also reads the priority. Pass the |
| 24870 | // priority as an argument to that function and this one. |
| 24871 | |
| 24872 | var priorityLevel = getCurrentPriorityLevel(); |
| 24873 | |
| 24874 | if (expirationTime === Sync) { |
| 24875 | if ( // Check if we're inside unbatchedUpdates |
| 24876 | (executionContext & LegacyUnbatchedContext) !== NoContext && // Check if we're not already rendering |
| 24877 | (executionContext & (RenderContext | CommitContext)) === NoContext) { |
| 24878 | // Register pending interactions on the root to avoid losing traced interaction data. |
| 24879 | schedulePendingInteractions(root, expirationTime); // This is a legacy edge case. The initial mount of a ReactDOM.render-ed |
| 24880 | // root inside of batchedUpdates should be synchronous, but layout updates |
| 24881 | // should be deferred until the end of the batch. |
| 24882 | |
| 24883 | performSyncWorkOnRoot(root); |
| 24884 | } else { |
| 24885 | ensureRootIsScheduled(root); |
| 24886 | schedulePendingInteractions(root, expirationTime); |
| 24887 | |
| 24888 | if (executionContext === NoContext) { |
| 24889 | // Flush the synchronous work now, unless we're already working or inside |
| 24890 | // a batch. This is intentionally inside scheduleUpdateOnFiber instead of |
| 24891 | // scheduleCallbackForFiber to preserve the ability to schedule a callback |
| 24892 | // without immediately flushing it. We only do this for user-initiated |
| 24893 | // updates, to preserve historical behavior of legacy mode. |
| 24894 | flushSyncCallbackQueue(); |
| 24895 | } |
| 24896 | } |
| 24897 | } else { |
| 24898 | ensureRootIsScheduled(root); |
| 24899 | schedulePendingInteractions(root, expirationTime); |
| 24900 | } |
| 24901 | |
| 24902 | if ((executionContext & DiscreteEventContext) !== NoContext && ( // Only updates at user-blocking priority or greater are considered |
| 24903 | // discrete, even inside a discrete event. |
| 24904 | priorityLevel === UserBlockingPriority$1 || priorityLevel === ImmediatePriority)) { |
| 24905 | // This is the result of a discrete event. Track the lowest priority |
| 24906 | // discrete update per root so we can flush them early, if needed. |
| 24907 | if (rootsWithPendingDiscreteUpdates === null) { |
| 24908 | rootsWithPendingDiscreteUpdates = new Map([[root, expirationTime]]); |
| 24909 | } else { |
| 24910 | var lastDiscreteTime = rootsWithPendingDiscreteUpdates.get(root); |
| 24911 | |
| 24912 | if (lastDiscreteTime === undefined || lastDiscreteTime > expirationTime) { |
| 24913 | rootsWithPendingDiscreteUpdates.set(root, expirationTime); |
| 24914 | } |
| 24915 | } |
nothing calls this directly
no test coverage detected