dillon1000/react
Commit
Browse files [Fiber] Always flush Default priority in the microtask if a Transition was scheduled (#33186)
Stacked on #33160. The purpose of this is to avoid calling `onDefaultTransitionIndicator` when a Default priority update acts as the loading indicator, but still call it when unrelated Default updates happens nearby. When we schedule Default priority work that gets batched with other events in the same frame more or less. This helps optimize by doing less work. However, that batching means that we can't separate work from one setState from another. If we would consider all Default priority work in a frame when determining whether to show the default we might never show it in cases like when you have a recurring timer updating something. This instead flushes the Default priority work eagerly along with the sync work at the end of the event, if this event scheduled any Transition work. This is then used to determine if the default indicator needs to be shown.
Changed paths2 files
First-parent comparisonpackages/react-reconciler/src/ReactFiberRootScheduler.js ModifiedM packages/react-reconciler/src/__tests__/ReactDefaultTransitionIndicator-test.js ModifiedPatch
Files changed
Rendering syntax-highlighted changes…