mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Add source location to debug logging info
This commit is contained in:
@@ -1925,7 +1925,7 @@ export function attach(
|
||||
owners,
|
||||
|
||||
// Location of component in source coude.
|
||||
source: _debugSource,
|
||||
source: _debugSource || null,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1986,6 +1986,9 @@ export function attach(
|
||||
if (nativeNodes !== null) {
|
||||
console.log('Nodes:', nativeNodes);
|
||||
}
|
||||
if (result.source !== null) {
|
||||
console.log('Location:', result.source);
|
||||
}
|
||||
if (window.chrome || /firefox/i.test(navigator.userAgent)) {
|
||||
console.log(
|
||||
'Right-click any value to save it as a global variable for further inspection.'
|
||||
|
||||
@@ -191,7 +191,7 @@ export type InspectedElement = {|
|
||||
owners: Array<Owner> | null,
|
||||
|
||||
// Location of component in source coude.
|
||||
source: Object | null,
|
||||
source: Source | null,
|
||||
|
||||
type: ElementType,
|
||||
|};
|
||||
|
||||
@@ -44,6 +44,11 @@ export type OwnersList = {|
|
||||
owners: Array<Owner> | null,
|
||||
|};
|
||||
|
||||
export type Source = {|
|
||||
fileName: string,
|
||||
lineNumber: number,
|
||||
|};
|
||||
|
||||
export type InspectedElement = {|
|
||||
id: number,
|
||||
|
||||
@@ -72,7 +77,7 @@ export type InspectedElement = {|
|
||||
owners: Array<Owner> | null,
|
||||
|
||||
// Location of component in source coude.
|
||||
source: Object | null,
|
||||
source: Source | null,
|
||||
|
||||
type: ElementType,
|
||||
|};
|
||||
|
||||
Reference in New Issue
Block a user