| 519 | } |
| 520 | |
| 521 | export 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. |
| 546 | export function createFiberFromTypeAndProps( |