Skip to content

Commit 459c34f

Browse files
authored
Add flag concurrent root to Fabric render function (#21552)
* Add flag concurrent root to Fabric render function * Lint
1 parent a731a51 commit 459c34f

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

packages/react-native-renderer/src/ReactFabric.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ import {
4040
getInspectorDataForViewTag,
4141
getInspectorDataForViewAtPoint,
4242
} from './ReactNativeFiberInspector';
43-
import {LegacyRoot} from 'react-reconciler/src/ReactRootTags';
43+
import {LegacyRoot, ConcurrentRoot} from 'react-reconciler/src/ReactRootTags';
4444
import ReactSharedInternals from 'shared/ReactSharedInternals';
4545
import getComponentNameFromType from 'shared/getComponentNameFromType';
4646

@@ -201,13 +201,21 @@ function render(
201201
element: Element<ElementType>,
202202
containerTag: number,
203203
callback: ?() => void,
204+
concurrentRoot: ?boolean,
204205
): ?ElementRef<ElementType> {
205206
let root = roots.get(containerTag);
206207

207208
if (!root) {
208209
// TODO (bvaughn): If we decide to keep the wrapper component,
209210
// We could create a wrapper for containerTag as well to reduce special casing.
210-
root = createContainer(containerTag, LegacyRoot, false, null, false, null);
211+
root = createContainer(
212+
containerTag,
213+
concurrentRoot ? ConcurrentRoot : LegacyRoot,
214+
false,
215+
null,
216+
false,
217+
null,
218+
);
211219
roots.set(containerTag, root);
212220
}
213221
updateContainer(element, root, null, callback);

0 commit comments

Comments
 (0)