Skip to content

Commit

Permalink
fix: Breadcrumbs improvements (#654)
Browse files Browse the repository at this point in the history
  • Loading branch information
maciaszczykm authored Oct 8, 2024
1 parent 01f01a8 commit bcb96a8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions src/components/Breadcrumbs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -341,9 +341,11 @@ export function DynamicBreadcrumbs({

const refitCrumbList = useCallback(
({ width: wrapperWidth }: { width: number }) => {
const lists = Array.from(
wrapperRef?.current?.querySelectorAll(`[${CRUMB_LIST_ATTR}]`)
)
const lists = wrapperRef?.current
? Array.from(
wrapperRef.current.querySelectorAll(`[${CRUMB_LIST_ATTR}]`)
)
: []
const { id } = lists.reduce(
(prev, next) => {
const prevWidth = prev.width
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useResizeObserver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const useResizeObserver = (
RO.observe(ref.current)

return () => {
RO.disconnect()
RO?.disconnect()
RO = null
}
}, [ref, handleResize])
Expand Down

0 comments on commit bcb96a8

Please sign in to comment.