Skip to content

Commit

Permalink
Inject ReactDebugCurrentFrame into DevTools so it can append componen…
Browse files Browse the repository at this point in the history
…t stacks to warnings in DEV mode (facebook#16127)
  • Loading branch information
Brian Vaughn committed Jul 13, 2019
1 parent fcff9c5 commit 9f39590
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/react-reconciler/src/ReactFiberReconciler.js
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ if (__DEV__) {

export function injectIntoDevTools(devToolsConfig: DevToolsConfig): boolean {
const {findFiberByHostInstance} = devToolsConfig;
const {ReactCurrentDispatcher} = ReactSharedInternals;
const {ReactCurrentDispatcher, ReactDebugCurrentFrame} = ReactSharedInternals;

return injectInternals({
...devToolsConfig,
Expand Down Expand Up @@ -501,5 +501,7 @@ export function injectIntoDevTools(devToolsConfig: DevToolsConfig): boolean {
scheduleRefresh: __DEV__ ? scheduleRefresh : null,
scheduleRoot: __DEV__ ? scheduleRoot : null,
setRefreshHandler: __DEV__ ? setRefreshHandler : null,
// Enables DevTools to append component stack to error messages in DEV mode.
debugCurrentFrame: ReactDebugCurrentFrame,
});
}

0 comments on commit 9f39590

Please sign in to comment.