Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue #21065 getInspectorDataForViewTag is not a function #21237

Closed
wants to merge 5 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions Libraries/Inspector/Inspector.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,11 @@ function findRenderers(): $ReadOnlyArray<ReactRenderer> {
function getInspectorDataForViewTag(touchedViewTag: number) {
for (let i = 0; i < renderers.length; i++) {
const renderer = renderers[i];
const inspectorData = renderer.getInspectorDataForViewTag(touchedViewTag);
if (inspectorData.hierarchy.length > 0) {
return inspectorData;
if (Object.prototype.hasOwnProperty.call(renderer, 'getInspectorDataForViewTag')) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prettier/prettier: Replace Object.prototype.hasOwnProperty.call(renderer,·'getInspectorDataForViewTag') with ⏎······Object.prototype.hasOwnProperty.call(⏎········renderer,⏎········'getInspectorDataForViewTag',⏎······)⏎····

const inspectorData = renderer.getInspectorDataForViewTag(touchedViewTag);
if (inspectorData.hierarchy.length > 0) {
return inspectorData;
}
}
}
throw new Error('Expected to find at least one React renderer.');
Expand Down