Skip to content

Commit

Permalink
fix: custom icons not rendering with <CssInterop.xx />
Browse files Browse the repository at this point in the history
  • Loading branch information
gunnartorfis committed Sep 10, 2024
1 parent c64256a commit c7f281d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
12 changes: 12 additions & 0 deletions example/src/ToastDemo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,18 @@ export const ToastDemo: React.FC = () => {
title="Custom id"
onPress={() => toast('Custom id', { id: '123' })}
/>
<Button
title="Custom icon"
onPress={() => {
toast('Custom icon', {
icon: (
<View>
<Text>🚀</Text>
</View>
),
});
}}
/>
<Button title="Show outside of a React component" onPress={handleToast} />
<Button
title="Toast with a promise"
Expand Down
4 changes: 3 additions & 1 deletion src/toast.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,9 @@ export const Toast: React.FC<ToastProps> = ({
) : (
<ActivityIndicator />
)
) : icon || variant in icons ? (
) : icon ? (
<View>{icon}</View>
) : variant in icons ? (
icons[variant]
) : (
<ToastIcon variant={variant} invert={invert} />
Expand Down

0 comments on commit c7f281d

Please sign in to comment.