MCPcopy
hub / github.com/facebook/react / createHostRootFiber

Function createHostRootFiber

packages/react-reconciler/src/ReactFiber.js:521–543  ·  view source on GitHub ↗
(
  tag: RootTag,
  isStrictMode: boolean,
)

Source from the content-addressed store, hash-verified

519}
520
521export function createHostRootFiber(
522 tag: RootTag,
523 isStrictMode: boolean,
524): Fiber {
525 let mode: number;
526 if (disableLegacyMode || tag === ConcurrentRoot) {
527 mode = ConcurrentMode;
528 if (isStrictMode === true) {
529 mode |= StrictLegacyMode | StrictEffectsMode;
530 }
531 } else {
532 mode = NoMode;
533 }
534
535 if (__DEV__ || (enableProfilerTimer && isDevToolsPresent)) {
536 // dev: Enable profiling instrumentation by default.
537 // profile: enabled if DevTools is present or subtree is wrapped in <Profiler>.
538 // production: disabled.
539 mode |= ProfileMode;
540 }
541
542 return createFiber(HostRoot, null, null, mode);
543}
544
545// TODO: Get rid of this helper. Only createFiberFromElement should exist.
546export function createFiberFromTypeAndProps(

Callers 1

createFiberRootFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected