Skip to content

Commit

Permalink
fix array from issue
Browse files Browse the repository at this point in the history
  • Loading branch information
maciaszczykm committed Oct 8, 2024
1 parent c0cfa40 commit 78d930c
Showing 1 changed file with 5 additions and 3 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

0 comments on commit 78d930c

Please sign in to comment.