diff --git a/code/ui/components/src/tabs/tabs.hooks.tsx b/code/ui/components/src/tabs/tabs.hooks.tsx index 5ee337ce3b71..1b6cfafef206 100644 --- a/code/ui/components/src/tabs/tabs.hooks.tsx +++ b/code/ui/components/src/tabs/tabs.hooks.tsx @@ -141,11 +141,7 @@ export function useList(list: ChildrenList) { const newInvisibleList = list.filter((item) => { const { id } = item; const tabButton = tabRefs.current.get(id); - - if (!tabButton) { - return false; - } - const { width: tabWidth } = tabButton.getBoundingClientRect(); + const { width: tabWidth = 0 } = tabButton?.getBoundingClientRect() || {}; const crossBorder = x + widthSum + tabWidth > rightBorder;