Skip to content

Commit

Permalink
Add debugInfo to Fibers
Browse files Browse the repository at this point in the history
  • Loading branch information
sebmarkbage committed Feb 12, 2024
1 parent cd0281c commit 2370754
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/react-reconciler/src/ReactFiber.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ function FiberNode(

if (__DEV__) {
// This isn't directly used but is handy for debugging internals:

this._debugInfo = null;
this._debugOwner = null;
this._debugNeedsRemount = false;
this._debugHookTypes = null;
Expand Down Expand Up @@ -347,6 +347,7 @@ export function createWorkInProgress(current: Fiber, pendingProps: any): Fiber {
}

if (__DEV__) {
workInProgress._debugInfo = current._debugInfo;
workInProgress._debugNeedsRemount = current._debugNeedsRemount;
switch (workInProgress.tag) {
case IndeterminateComponent:
Expand Down Expand Up @@ -911,6 +912,7 @@ export function assignFiberPropertiesInDEV(
target.treeBaseDuration = source.treeBaseDuration;
}

target._debugInfo = source._debugInfo;
target._debugOwner = source._debugOwner;
target._debugNeedsRemount = source._debugNeedsRemount;
target._debugHookTypes = source._debugHookTypes;
Expand Down
2 changes: 2 additions & 0 deletions packages/react-reconciler/src/ReactInternalTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import type {
Usable,
ReactFormState,
Awaited,
ReactDebugInfo,
} from 'shared/ReactTypes';
import type {WorkTag} from './ReactWorkTags';
import type {TypeOfMode} from './ReactTypeOfMode';
Expand Down Expand Up @@ -199,6 +200,7 @@ export type Fiber = {
// to be the same as work in progress.
// __DEV__ only

_debugInfo?: ReactDebugInfo | null,
_debugOwner?: Fiber | null,
_debugIsCurrentlyTiming?: boolean,
_debugNeedsRemount?: boolean,
Expand Down

0 comments on commit 2370754

Please sign in to comment.