From 78d930c585edb6c8902cac1827f12c3c4138d05c Mon Sep 17 00:00:00 2001 From: Marcin Maciaszczyk Date: Tue, 8 Oct 2024 14:16:58 +0200 Subject: [PATCH] fix array from issue --- src/components/Breadcrumbs.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/Breadcrumbs.tsx b/src/components/Breadcrumbs.tsx index 421587c6..3eb37779 100644 --- a/src/components/Breadcrumbs.tsx +++ b/src/components/Breadcrumbs.tsx @@ -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