Skip to content

Commit e347e83

Browse files
committed
Run debug context in the console Task of the fiber
This creates a native "owner stack" for the execution context. Any JSX created within this context will get new tasks created continuing the stack.
1 parent 91b10c0 commit e347e83

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

packages/react-reconciler/src/ReactCurrentFiber.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,13 @@ export function runWithFiberInDEV<A0, A1, A2, A3, A4, T>(
7474
const previousFiber = current;
7575
setCurrentFiber(fiber);
7676
try {
77+
if (enableOwnerStacks) {
78+
if (fiber !== null && fiber._debugTask) {
79+
return fiber._debugTask.run(
80+
callback.bind(null, arg0, arg1, arg2, arg3, arg4),
81+
);
82+
}
83+
}
7784
return callback(arg0, arg1, arg2, arg3, arg4);
7885
} finally {
7986
current = previousFiber;

0 commit comments

Comments
 (0)