Stop spamming highlight events when a component is selected (#25448)

This commit is contained in:
Tianyu Yao 2022-10-13 17:38:05 -07:00 committed by GitHub
parent 08d035bc8f
commit fd31724d5d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -131,21 +131,6 @@ export function connectToDevTools(options: ?ConnectOptions) {
} }
}, },
}); });
bridge.addListener(
'inspectElement',
({id, rendererID}: {id: number, rendererID: number, ...}) => {
const renderer = agent.rendererInterfaces[rendererID];
if (renderer != null) {
// Send event for RN to highlight.
const nodes: ?Array<HTMLElement> = renderer.findNativeNodesForFiberID(
id,
);
if (nodes != null && nodes[0] != null) {
agent.emit('showNativeHighlight', nodes[0]);
}
}
},
);
// $FlowFixMe[incompatible-use] found when upgrading Flow // $FlowFixMe[incompatible-use] found when upgrading Flow
bridge.addListener( bridge.addListener(
'updateComponentFilters', 'updateComponentFilters',