Skip to content

Commit d1d6396

Browse files
hoxyqfacebook-github-bot
authored andcommitted
refactor: remove source usages from getInspectorData
Summary: Changelog: [Internal] Required for landing D53543159. 3 reasons for landing this: 1. Inspector is technically deprecated and will be removed once React DevTools are shipped with Chrome DevTools for RN debugging. 2. Long-term solution for source fetching is lazy loading based on component stacks - facebook/react#28265 3. Although `source` field is accumulated and stored, it is not displayed anywhere, see InspectorOverlay.js. Differential Revision: D53757524
1 parent a68ae2e commit d1d6396

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

packages/react-native/Libraries/Inspector/Inspector.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,8 @@ type SelectedTab =
3838
| 'performance-profiling';
3939

4040
export type InspectedElementFrame = TouchedViewDataAtPoint['frame'];
41-
export type InspectedElementSource = InspectorData['source'];
4241
export type InspectedElement = $ReadOnly<{
4342
frame: InspectedElementFrame,
44-
source?: InspectedElementSource,
4543
style?: ViewStyleProp,
4644
}>;
4745
export type ElementsHierarchy = InspectorData['hierarchy'];
@@ -74,14 +72,12 @@ function Inspector({
7472
}
7573

7674
// We pass in findNodeHandle as the method is injected
77-
const {measure, props, source} =
78-
hierarchyItem.getInspectorData(findNodeHandle);
75+
const {measure, props} = hierarchyItem.getInspectorData(findNodeHandle);
7976

8077
measure((x, y, width, height, left, top) => {
8178
// $FlowFixMe[incompatible-call] `props` from InspectorData are defined as <string, string> dictionary, which is incompatible with ViewStyleProp
8279
setInspectedElement({
8380
frame: {left, top, width, height},
84-
source,
8581
style: props.style,
8682
});
8783

@@ -95,7 +91,6 @@ function Inspector({
9591
hierarchy,
9692
props,
9793
selectedIndex,
98-
source,
9994
frame,
10095
pointerY,
10196
touchedViewTag,
@@ -120,7 +115,6 @@ function Inspector({
120115
// $FlowFixMe[incompatible-call] `props` from InspectorData are defined as <string, string> dictionary, which is incompatible with ViewStyleProp
121116
setInspectedElement({
122117
frame,
123-
source,
124118
style: props.style,
125119
});
126120
};

0 commit comments

Comments
 (0)