mirror of
https://github.com/facebook/react.git
synced 2026-11-18 20:15:56 +00:00
Inject getCurrentFiber() function to DevTools (#16133)
This returns the current value of ReactCurrentFiber and enables DevTools to append a custom (owner-only) component stack to warnings and errors in DEV mode.
This commit is contained in:
1 parent
9f395904c6
commit
424099da60
1 file changed
+3
-3
+3
-3
@@ -473,7 +473,7 @@ if (__DEV__) {
|
||||
|
||||
export function injectIntoDevTools(devToolsConfig: DevToolsConfig): boolean {
|
||||
const {findFiberByHostInstance} = devToolsConfig;
|
||||
const {ReactCurrentDispatcher, ReactDebugCurrentFrame} = ReactSharedInternals;
|
||||
const {ReactCurrentDispatcher} = ReactSharedInternals;
|
||||
|
||||
return injectInternals({
|
||||
...devToolsConfig,
|
||||
@@ -501,7 +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,
|
||||
// Enables DevTools to append owner stacks to error messages in DEV mode.
|
||||
getCurrentFiber: __DEV__ ? () => ReactCurrentFiberCurrent : null,
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user