Skip to content

Commit b7a663c

Browse files
committed
[Reconciler] Set ProfileMode for Host Root Fiber by default in dev
1 parent b2cff47 commit b7a663c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/react-reconciler/src/ReactFiber.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -532,10 +532,10 @@ export function createHostRootFiber(
532532
mode = NoMode;
533533
}
534534

535-
if (enableProfilerTimer && isDevToolsPresent) {
536-
// Always collect profile timings when DevTools are present.
537-
// This enables DevTools to start capturing timing at any point–
538-
// Without some nodes in the tree having empty base times.
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.
539539
mode |= ProfileMode;
540540
}
541541

0 commit comments

Comments
 (0)