Skip to content

Commit

Permalink
fix: Check if something collection node not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
zombieJ committed Aug 18, 2020
1 parent 7b38a2b commit b50b69b
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/TabNavList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -335,12 +335,14 @@ function TabNavList(props: TabNavListProps, ref: React.Ref<HTMLDivElement>) {
const newSizes: TabSizeMap = new Map();
tabs.forEach(({ key }) => {
const btnNode = getBtnRef(key).current;
newSizes.set(key, {
width: btnNode.offsetWidth,
height: btnNode.offsetHeight,
left: btnNode.offsetLeft,
top: btnNode.offsetTop,
});
if (btnNode) {
newSizes.set(key, {
width: btnNode.offsetWidth,
height: btnNode.offsetHeight,
left: btnNode.offsetLeft,
top: btnNode.offsetTop,
});
}
});
return newSizes;
});
Expand Down

0 comments on commit b50b69b

Please sign in to comment.