mirror of
https://github.com/facebook/react.git
synced 2026-02-22 03:42:05 +00:00
[DevTools] Update inspected element on component filter changes (#35599)
This commit is contained in:
committed by
GitHub
parent
a0566250b2
commit
2c30ebc4e3
@@ -1086,6 +1086,15 @@ export default class Agent extends EventEmitter<{
|
||||
}
|
||||
renderer.updateComponentFilters(componentFilters);
|
||||
}
|
||||
|
||||
// Due to the component filters changing, we might be able
|
||||
// to select a closer match for the currently selected host element.
|
||||
// The store will already select a suitable parent if the the current
|
||||
// selection is now filtered out in which cases this will be a no-op.
|
||||
const target = window.__REACT_DEVTOOLS_GLOBAL_HOOK__.$0;
|
||||
if (target != null) {
|
||||
this.selectNode(target);
|
||||
}
|
||||
};
|
||||
|
||||
getEnvironmentNames: () => void = () => {
|
||||
|
||||
Reference in New Issue
Block a user