Skip to content

Commit eccfc11

Browse files
committed
fix(react-native): prevent rest props from overriding Toast defaults by moving {...props} before explicit props (backgroundColor, borders, twClassName) and ensuring onClose cannot leak through
1 parent 167c0ab commit eccfc11

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • packages/design-system-react-native/src/components/Toast

packages/design-system-react-native/src/components/Toast/Toast.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ export const Toast: React.FC<ToastProps> = ({
7373
return (
7474
<BannerBase
7575
{...actionProps}
76+
{...props}
7677
backgroundColor={BoxBackgroundColor.BackgroundSection}
7778
borderColor={BoxBorderColor.BorderMuted}
7879
borderWidth={1}
@@ -97,7 +98,6 @@ export const Toast: React.FC<ToastProps> = ({
9798
title={title}
9899
titleProps={titleProps}
99100
twClassName={twClassName ? `rounded-xl ${twClassName}` : 'rounded-xl'}
100-
{...props}
101101
/>
102102
);
103103
};

0 commit comments

Comments
 (0)