From a67b62ce90d57c294bbf23377e606106899b8940 Mon Sep 17 00:00:00 2001 From: Taya Leutina Date: Sat, 27 Apr 2024 18:45:19 +0300 Subject: [PATCH] fix(Footer): fix warning with setState on unmounted component (#233) --- .../useOverflowingHorizontalListItems.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hooks/useOverflowingHorizontalListItems/useOverflowingHorizontalListItems.ts b/src/hooks/useOverflowingHorizontalListItems/useOverflowingHorizontalListItems.ts index fda08bf9..2608390e 100644 --- a/src/hooks/useOverflowingHorizontalListItems/useOverflowingHorizontalListItems.ts +++ b/src/hooks/useOverflowingHorizontalListItems/useOverflowingHorizontalListItems.ts @@ -41,7 +41,7 @@ export function useOverflowingHorizontalListItems({ } const updateContainerSize = (entries: ResizeObserverEntry[]) => { - if (entries.length > 0) { + if (entries.length > 0 && footerMenu) { setContainerWidth(entries[0].contentRect.width); } };