Add flag concurrent root to Fabric render function (#21552)
* Add flag concurrent root to Fabric render function * Lint
This commit is contained in:
parent
a731a51696
commit
459c34fde6
|
@ -40,7 +40,7 @@ import {
|
|||
getInspectorDataForViewTag,
|
||||
getInspectorDataForViewAtPoint,
|
||||
} from './ReactNativeFiberInspector';
|
||||
import {LegacyRoot} from 'react-reconciler/src/ReactRootTags';
|
||||
import {LegacyRoot, ConcurrentRoot} from 'react-reconciler/src/ReactRootTags';
|
||||
import ReactSharedInternals from 'shared/ReactSharedInternals';
|
||||
import getComponentNameFromType from 'shared/getComponentNameFromType';
|
||||
|
||||
|
@ -201,13 +201,21 @@ function render(
|
|||
element: Element<ElementType>,
|
||||
containerTag: number,
|
||||
callback: ?() => void,
|
||||
concurrentRoot: ?boolean,
|
||||
): ?ElementRef<ElementType> {
|
||||
let root = roots.get(containerTag);
|
||||
|
||||
if (!root) {
|
||||
// TODO (bvaughn): If we decide to keep the wrapper component,
|
||||
// We could create a wrapper for containerTag as well to reduce special casing.
|
||||
root = createContainer(containerTag, LegacyRoot, false, null, false, null);
|
||||
root = createContainer(
|
||||
containerTag,
|
||||
concurrentRoot ? ConcurrentRoot : LegacyRoot,
|
||||
false,
|
||||
null,
|
||||
false,
|
||||
null,
|
||||
);
|
||||
roots.set(containerTag, root);
|
||||
}
|
||||
updateContainer(element, root, null, callback);
|
||||
|
|
Loading…
Reference in New Issue