Skip to content

Commit

Permalink
fix: handle missing fiber when inspecting elements
Browse files Browse the repository at this point in the history
  • Loading branch information
pivanov committed Jan 11, 2025
1 parent d6ccbc0 commit 24e429b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/scan/src/web/components/inspector/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1256,6 +1256,13 @@ export const Inspector = constant(() => {
const element = inspectState.focusedDomElement;
const { parentCompositeFiber } = getCompositeFiberFromElement(element);

if (!parentCompositeFiber) {
Store.inspectState.value = {
kind: 'inspect-off',
};
return;
}

if (parentCompositeFiber && refLastInspectedFiber.current) {
processFiberUpdate(parentCompositeFiber, element);
}
Expand Down

0 comments on commit 24e429b

Please sign in to comment.