Skip to content

Commit

Permalink
X2-8166 fix(breakdown): resolves context destructuring issue
Browse files Browse the repository at this point in the history
  • Loading branch information
kirtesh-xola committed Dec 29, 2023
1 parent df91881 commit 42a80ea
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/Breakdown.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 <Breakdown /> component, the context would be `undefined` */
const { currency, locale } = useContext(CurrencyContext) ?? {};

return (
<tr className={clsx("ui-breakdown-item", colors[color], className)} {...rest}>
Expand Down

0 comments on commit 42a80ea

Please sign in to comment.