Skip to content

Commit 9f39590

Browse files
author
Brian Vaughn
authored
Inject ReactDebugCurrentFrame into DevTools so it can append component stacks to warnings in DEV mode (#16127)
1 parent fcff9c5 commit 9f39590

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

packages/react-reconciler/src/ReactFiberReconciler.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ if (__DEV__) {
473473

474474
export function injectIntoDevTools(devToolsConfig: DevToolsConfig): boolean {
475475
const {findFiberByHostInstance} = devToolsConfig;
476-
const {ReactCurrentDispatcher} = ReactSharedInternals;
476+
const {ReactCurrentDispatcher, ReactDebugCurrentFrame} = ReactSharedInternals;
477477

478478
return injectInternals({
479479
...devToolsConfig,
@@ -501,5 +501,7 @@ export function injectIntoDevTools(devToolsConfig: DevToolsConfig): boolean {
501501
scheduleRefresh: __DEV__ ? scheduleRefresh : null,
502502
scheduleRoot: __DEV__ ? scheduleRoot : null,
503503
setRefreshHandler: __DEV__ ? setRefreshHandler : null,
504+
// Enables DevTools to append component stack to error messages in DEV mode.
505+
debugCurrentFrame: ReactDebugCurrentFrame,
504506
});
505507
}

0 commit comments

Comments
 (0)