Skip to content

Commit

Permalink
Run debug context in the console Task of the fiber
Browse files Browse the repository at this point in the history
This creates a native "owner stack" for the execution context. Any JSX
created within this context will get new tasks created continuing the stack.
  • Loading branch information
sebmarkbage committed May 23, 2024
1 parent d66b3c0 commit 63dcec8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/react-reconciler/src/ReactCurrentFiber.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,13 @@ export function runWithFiberInDEV<A0, A1, A2, A3, A4, T>(
const previousFiber = current;
setCurrentFiber(fiber);
try {
if (enableOwnerStacks) {
if (fiber !== null && fiber._debugTask) {
return fiber._debugTask.run(
callback.bind(null, arg0, arg1, arg2, arg3, arg4),
);
}
}
return callback(arg0, arg1, arg2, arg3, arg4);
} finally {
current = previousFiber;
Expand Down

0 comments on commit 63dcec8

Please sign in to comment.