Configure toasts to appear above modals on Android with ToastPortal or containedModal
By default, toasts automatically appear above native modals on iOS. On Android, native modals render outside the React hierarchy, requiring additional setup to show toasts above them.
On iOS, <BreadLoaf /> uses FullWindowOverlay from react-native-screens to render toasts in a native window above all other content, including modals. No additional setup is needed.
// iOS: Works automaticallyimport { BreadLoaf } from 'react-native-bread';import { Stack } from 'expo-router';export default function RootLayout() { return ( <> <Stack> <Stack.Screen name="index" /> <Stack.Screen name="modal" options={{ presentation: 'modal' }} /> </Stack> <BreadLoaf /> </> );}
The easiest solution is to use containedModal presentation on Android. This renders the modal within the React hierarchy, so toasts from your root <BreadLoaf /> remain visible.
On Android, modal and containedModal look nearly identical to the user. The main difference is whether the modal renders in a native window (modal) or within the React tree (containedModal).
Changed presentation to 'containedModal' on Android, OR
Added <ToastPortal /> inside your modal layout
Check that the modal is actually rendering as a native modal (check the screen options).
Toasts appear twice on Android
You may have both <BreadLoaf /> and <ToastPortal /> configured for a containedModal. Use ToastPortal only for native modals (presentation: 'modal').
// ❌ Don't do this<Stack.Screen name="modal" options={{ presentation: 'containedModal' }}/>// ... with ToastPortal in the modal layout// ✅ Do this instead<Stack.Screen name="modal" options={{ presentation: 'containedModal' }}/>// ... no ToastPortal needed
Different toast styles in modal vs main app
ToastPortal inherits configuration from your root <BreadLoaf />. Make sure you’re not creating multiple BreadLoaf instances with different configs.All configuration should be done in one place:
// ✅ Configure once in root layout<BreadLoaf config={{ position: 'bottom', ... }} />// ✅ ToastPortal in modal (no config)<ToastPortal />
Toasts work on iOS but not Android
This is expected behavior if you’re using native modals without ToastPortal. Add ToastPortal to your modal layouts or switch to containedModal presentation.
A lightweight toast renderer for Android modals. Returns null on iOS.Usage: Place inside modal layout components where you need toasts to appear above native Android modals.Inherits: All configuration from root <BreadLoaf /> component.Platform: Android only (returns null on iOS).