Skip to content

Commit

Permalink
fix(SegmentedButton): check if ref to html element still exists befor…
Browse files Browse the repository at this point in the history
…e accessing members on it (#260)
  • Loading branch information
vbersch authored Jan 8, 2020
1 parent 25d2057 commit c9788c9
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions packages/main/src/components/SegmentedButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ const SegmentedButton: FC<SegmentedButtonPropTypes> = forwardRef(

useEffect(() => {
requestAnimationFrame(() => {
if (!listRef.current) return;
let maxWidth = 0;
for (let i = 0; i < listRef.current.childElementCount; i++) {
const item = listRef.current.children.item(i) as HTMLLIElement;
Expand Down

0 comments on commit c9788c9

Please sign in to comment.