diff --git a/packages/react-reconciler/src/ReactFiberBeginWork.js b/packages/react-reconciler/src/ReactFiberBeginWork.js
index b6cd356197d6d..1ad67e7357334 100644
--- a/packages/react-reconciler/src/ReactFiberBeginWork.js
+++ b/packages/react-reconciler/src/ReactFiberBeginWork.js
@@ -84,13 +84,7 @@ import {
Never,
computeAsyncExpiration,
} from './ReactFiberExpirationTime';
-import {
- ConcurrentMode,
- NoMode,
- ProfileMode,
- StrictMode,
- BatchedMode,
-} from './ReactTypeOfMode';
+import {NoMode, ProfileMode, StrictMode, BatchedMode} from './ReactTypeOfMode';
import {
shouldSetTextContent,
shouldDeprioritizeSubtree,
@@ -980,7 +974,7 @@ function updateHostComponent(current, workInProgress, renderExpirationTime) {
// Check the host config to see if the children are offscreen/hidden.
if (
- workInProgress.mode & ConcurrentMode &&
+ workInProgress.mode & BatchedMode &&
renderExpirationTime !== Never &&
shouldDeprioritizeSubtree(type, nextProps)
) {
@@ -2257,7 +2251,7 @@ function beginWork(
case HostComponent:
pushHostContext(workInProgress);
if (
- workInProgress.mode & ConcurrentMode &&
+ workInProgress.mode & BatchedMode &&
renderExpirationTime !== Never &&
shouldDeprioritizeSubtree(workInProgress.type, newProps)
) {
diff --git a/packages/react-reconciler/src/ReactFiberScheduler.js b/packages/react-reconciler/src/ReactFiberScheduler.js
index 3d7d17840bd48..9af59f8f542bf 100644
--- a/packages/react-reconciler/src/ReactFiberScheduler.js
+++ b/packages/react-reconciler/src/ReactFiberScheduler.js
@@ -64,6 +64,7 @@ import {
BatchedMode,
ConcurrentMode,
} from './ReactTypeOfMode';
+import {ConcurrentRoot} from 'shared/ReactRootTags';
import {
HostRoot,
ClassComponent,
@@ -776,6 +777,10 @@ function renderRoot(
'Should not already be working.',
);
+ if (root.tag !== ConcurrentRoot) {
+ isSync = true;
+ }
+
if (enableUserTimingAPI && expirationTime !== Sync) {
const didExpire = isSync;
stopRequestCallbackTimer(didExpire);
diff --git a/packages/react-reconciler/src/__tests__/ReactBatchedMode-test.internal.js b/packages/react-reconciler/src/__tests__/ReactBatchedMode-test.internal.js
index ea33035ca37a2..a4884c513056f 100644
--- a/packages/react-reconciler/src/__tests__/ReactBatchedMode-test.internal.js
+++ b/packages/react-reconciler/src/__tests__/ReactBatchedMode-test.internal.js
@@ -161,4 +161,46 @@ describe('ReactBatchedMode', () => {
expect(Scheduler).toFlushExpired(['A1']);
expect(root).toMatchRenderedOutput('A1B1');
});
+
+ it('hidden subtrees are deprioritized but not yieldy', () => {
+ const {useEffect} = React;
+
+ const root = ReactNoop.createSyncRoot();
+ function App() {
+ useEffect(() => Scheduler.yieldValue('Commit'));
+ return (
+