Skip to content

Commit d610003

Browse files
committed
Add comment
1 parent 2547b44 commit d610003

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

packages/react-reconciler/src/ReactFiberWorkLoop.new.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -714,6 +714,8 @@ function ensureRootIsScheduled(root: FiberRoot, currentTime: number) {
714714
// We don't support running callbacks in the middle of render
715715
// or commit so we need to check against that.
716716
if (executionContext === NoContext) {
717+
// It's only safe to do this conditionally because we always
718+
// check for pending work before we exit the task.
717719
flushSyncCallbacks();
718720
}
719721
});

packages/react-reconciler/src/ReactFiberWorkLoop.old.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -714,6 +714,8 @@ function ensureRootIsScheduled(root: FiberRoot, currentTime: number) {
714714
// We don't support running callbacks in the middle of render
715715
// or commit so we need to check against that.
716716
if (executionContext === NoContext) {
717+
// It's only safe to do this conditionally because we always
718+
// check for pending work before we exit the task.
717719
flushSyncCallbacks();
718720
}
719721
});

0 commit comments

Comments
 (0)