From ed0caf200ffb86facbc4246291751f616f3f7b94 Mon Sep 17 00:00:00 2001 From: Fireb0mb1 Date: Fri, 24 Feb 2023 00:32:49 +0100 Subject: [PATCH] fix: handle empty options without undef --- src/hooks/useLocaleFormatter/useLocaleFormatter.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hooks/useLocaleFormatter/useLocaleFormatter.ts b/src/hooks/useLocaleFormatter/useLocaleFormatter.ts index e7c88c20c3f..ab3e8b2d9f9 100644 --- a/src/hooks/useLocaleFormatter/useLocaleFormatter.ts +++ b/src/hooks/useLocaleFormatter/useLocaleFormatter.ts @@ -190,7 +190,7 @@ export const useLocaleFormatter = (args?: useLocaleFormatterArgs): NumberFormatt // Filter out undefined options caused by optional component props so they do not override the defaults const filteredOptions = options ? Object.fromEntries(Object.entries(options).filter(([_, value]) => value !== undefined)) - : undefined + : {} const formatter = new Intl.NumberFormat(deviceLocale, { notation: number < bounds.min || noDecimals ? 'standard' : 'compact', compactDisplay: fiatType || number < longCompactDisplayLowerBound ? 'short' : 'long',