Skip to content

Toast not visible on iOS when using SafeAreaProvider with React Navigation header #579

Description

@armendkras

When using react-native-toast-message in an Expo project with SafeAreaProvider from react-native-safe-area-context and @react-navigation/stack, toasts are not visible on iOS if the stack screen has a header. The toast appears to be rendered behind the navigation header.

Steps to reproduce

Wrap your app in SafeAreaProvider

Use a stack navigator from @react-navigation/stack with the default header shown

Render at the root level

Trigger a toast from any screen

Observe on iOS — the toast does not appear or is hidden behind the header

Expected behavior

Toast should appear above all content, including headers, when rendered at the top of the component tree.

Screenshots

If needed, include screenshots or a video of the behavior.

Code sample:
// App.tsx







// AuthNavigation.tsx
<Stack.Navigator>
<Stack.Screen name="Auth" component={SignInScreen} />
</Stack.Navigator>
Environment

OS: iOS 18.5

Expo SDK: 53

react-native: 0.79.5

react-native-toast-message: 2.3.3

react-native-safe-area-context: 5.4.0

@react-navigation/stack: 7.4.2

Additional context

This only occurs on iOS. Manually setting topOffset on the component doesn’t resolve the issue consistently. It appears to be a z-index/stacking issue when SafeArea and Stack headers are both involved.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions