question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Doesnt work with react-navigation/native

See original GitHub issue

The toaster doesnt appear when using @react-navigation/native lib. Have followed as shown in https://github.com/calintamas/react-native-toast-message#how-to-render-the-toast-when-using-react-navigation

I have placed <Toast/ > as last element inside <NavigationContainer>....</NavigationContainer>.

Any one else having same issue?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:3
  • Comments:18 (4 by maintainers)

github_iconTop GitHub Comments

47reactions
charlotteisambertcommented, May 26, 2021

I don’t know if this may help, but it didn’t work for me because I placed the Toast element above my screens. Make sure you placed the<Toast ref={(ref) => Toast.setRef(ref)} /> after all of your screens:

<NavigationContainer>
      {...}
      <Toast ref={(ref) => Toast.setRef(ref)} />
</NavigationContainer>

and not

<NavigationContainer>
      <Toast ref={(ref) => Toast.setRef(ref)} />
      {...}
</NavigationContainer>
9reactions
AdriaRioscommented, Aug 2, 2021

Hey @calintamas !

When we use a modal navigation, the toast appears below the view. We are following your recommendation, no luck.

Any idea? Thank you!

EDIT

Ok, I found why and maybe this could help to more people. To get the toast correctly working when you are using modals to navigate, the presentation prop must be:

  • containedModal
  • containedTransparentModal

If you use another type (modal, fullScreenModal or transparentModal), iOS will place the new modal above everything, including your awesome toast.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting | React Navigation
Sometimes you might have noticed that your screens unmount/remount, or your local component state or the navigation state resets when you navigate. This...
Read more >
navigation.navigate does not work in react native
1 Answer 1 · yes its working but 'navigation. · maybe you had another route called home in your stack or you just...
Read more >
navigate does not work on react native windows · Issue #10653
Current behavior https://reactnavigation.org/docs/navigation-prop/ The code is exactly the same as "Try this example on Snack" on this page, ...
Read more >
React Native Navigation: Tutorial with examples
In this React Native Navigation tutorial, we'll show you some examples of navigation patterns you can implement with React Navigation.
Read more >
Navigating Between Screens - React Native
This guide covers the various navigation components available in React Native. If you are getting started with navigation, you will probably ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found