From 42a80ea2024199d60e109bfb3b9158df0b20149a Mon Sep 17 00:00:00 2001 From: kirtesh-xola Date: Fri, 29 Dec 2023 12:12:45 +0530 Subject: [PATCH] X2-8166 fix(breakdown): resolves context destructuring issue --- src/components/Breakdown.jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/Breakdown.jsx b/src/components/Breakdown.jsx index e6d07931b..192dde075 100644 --- a/src/components/Breakdown.jsx +++ b/src/components/Breakdown.jsx @@ -36,7 +36,8 @@ Breakdown.propTypes = { }; const BreakdownItem = ({ children, info, methodIcon, secondary, value, className, color = "default", ...rest }) => { - const { currency, locale } = useContext(CurrencyContext); + /** When BreakdownItem is directly used without outer component, the context would be `undefined` */ + const { currency, locale } = useContext(CurrencyContext) ?? {}; return (