88
MEMO_SYMBOL_STRING,
89
SERVER_CONTEXT_SYMBOL_STRING,
90
} from './ReactSymbols';
91
-import {
92
- DidCapture,
93
- NoFlags,
94
- PerformedWork,
95
- Placement,
96
- Hydrating,
97
-} from './ReactFiberFlags';
91
import {format} from './utils';
92
import {
93
enableProfilerChangedHookIndices,
1548
case ForwardRef:
1549
// For types that execute user code, we check PerformedWork effect.
1550
// We don't reflect bailouts (either referential or sCU) in DevTools.
1558
- // eslint-disable-next-line no-bitwise
1551
+ // TODO: This flag is a leaked implementation detail. Once we start
1552
+ // releasing DevTools in lockstep with React, we should import a
1553
+ // function from the reconciler instead.
1554
+ const PerformedWork = 0b000000000000000000000000001;
1555
return (getFiberFlags(nextFiber) & PerformedWork) === PerformedWork;
1556
// Note: ContextConsumer only gets PerformedWork effect in 16.3.3+
1557
// so it won't get highlighted with React 16.3.0 to 16.3.2.
2839
let nextNode: Fiber = node;
2840
do {
2841
node = nextNode;
2846
- if ((node.flags & (Placement | Hydrating)) !== NoFlags) {
2842
+ // TODO: This function, and these flags, are a leaked implementation
2843
+ // detail. Once we start releasing DevTools in lockstep with React, we
2844
+ // should import a function from the reconciler instead.
2845
+ const Placement = 0b000000000000000000000000010;
2846
+ const Hydrating = 0b000000000000001000000000000;
2847
+ if ((node.flags & (Placement | Hydrating)) !== 0) {
2848
// This is an insertion or in-progress hydration. The nearest possible
2849
// mounted fiber is the parent but we need to continue to figure out
2850
// if that one is still mounted.
3301
const errors = fiberIDToErrorsMap.get(id) || new Map();
3302
const warnings = fiberIDToWarningsMap.get(id) || new Map();
3303
3303
- const isErrored =
3304
- (fiber.flags & DidCapture) !== NoFlags ||
3305
- forceErrorForFiberIDs.get(id) === true;
3306
-
3304
+ let isErrored = false;
3305
let targetErrorBoundaryID;
3306
if (isErrorBoundary(fiber)) {
3307
// if the current inspected element is an error boundary,
3308
// either that we want to use it to toggle off error state
3309
// or that we allow to force error state on it if it's within another
3310
// error boundary
3311
+ //
3312
+ // TODO: This flag is a leaked implementation detail. Once we start
3313
+ // releasing DevTools in lockstep with React, we should import a function
3314
+ // from the reconciler instead.
3315
+ const DidCapture = 0b000000000000000000010000000;
3316
+ isErrored =
3317
+ (fiber.flags & DidCapture) !== 0 ||
3318
+ forceErrorForFiberIDs.get(id) === true;
3319
targetErrorBoundaryID = isErrored ? id : getNearestErrorBoundaryID(fiber);
3320
} else {
3321
targetErrorBoundaryID = getNearestErrorBoundaryID(fiber);