From c64f25ac85d32186c0400b8aa27785280cdf2799 Mon Sep 17 00:00:00 2001 From: Tianyu Yao Date: Tue, 18 Oct 2022 10:35:11 -0700 Subject: [PATCH] Avoid redboxes when highlighting Summary: Changelog: [General][Fixed] - Fixed React DevTools element highlighting throwing redbox errors Reviewed By: lunaruan Differential Revision: D40367546 fbshipit-source-id: 094c4a512700f717efe06b7bfa304d94b6eed652 --- Libraries/Inspector/DevtoolsOverlay.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Libraries/Inspector/DevtoolsOverlay.js b/Libraries/Inspector/DevtoolsOverlay.js index 5f7e89a10ca0f5..4e7e4d5740fc2c 100644 --- a/Libraries/Inspector/DevtoolsOverlay.js +++ b/Libraries/Inspector/DevtoolsOverlay.js @@ -51,6 +51,9 @@ export default function DevtoolsOverlay({ clearTimeout(hideTimeoutId); // Shape of `node` is different in Fabric. const component = node.canonical ?? node; + if (!component) { + return; + } component.measure((x, y, width, height, left, top) => { setInspected({