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.

Integration with navigation libraries

See original GitHub issue

The behavior of components with Portal can be unintuitive in various navigation libraries such as React Navigation and Wix navigation, and even our own BottomNavigation component.

  • With React Navigation’s Tab Navigator and our Bottom Navigator, screens don’t unmount after navigating away. This means a component using portals such as FAB will stay rendered when the screen is not active
  • In navigation libraries like Wix, you need to wrap each screen in provider since there’s no single root

We need to document these scenarios and provide instructions on how to tackle them.

For React Navigation, the easiest solution could’ve been to wrap each screen in its own Provider like Wix, but that wouldn’t work well since the navigation bar, tab bar etc. are rendered outside the screen and things rendered in Portal won’t be able to cover the navigation bar and access theme from context. We would probably need to hook into react-navigation’s focus events to automatically manage visibility of items. So we would probably need to provide a custom Portal for React Navigation users.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:15
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

6reactions
eightyfivecommented, Jun 5, 2019

Side note, I can report at least one problem using react-native-paper with Wix Navigation (RNN).

Context: I am showing a small Toast/Snackbar at the bottom of the screen inside a RNN overlay.

But when using RNN interceptTouchOutside = false Overlay option, it seems like some component added by <PaperProvider /> is intercepting the taps, and not letting them through.

Navigation,showOverlay({
  component: {
    name: 'Toast',
    options: {
      overlay: {
        interceptTouchOutside: false
      }
    }
  }
})

I initially thought it was a RNN bug, but I can confirm it is not, removing <PaperProvider /> from my code made the RNN Overlay behave as expected.

UPDATE Using ThemeProvider directly solves the problem.

2reactions
cassioseffrincommented, Feb 20, 2019

Hello @satya164. I consider wix navigation v2 one of the best options for navigation. And react-native-paper is another good option for UI. Could you please give me one information about these two libraries. Both can work together or may they have some kind of incompatibility ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Get started with the Navigation component - Android Developers
Overview · Get started with TV apps · AndroidX TV libraries ... Integration tests with WorkManager · Debugging WorkManager.
Read more >
Alternative libraries - React Navigation
This is a popular alternative to React Navigation and may be a better fit for you if you are trying to integrate React...
Read more >
Navigation libraries - React Native - Bugsnag docs
Follow the integration instructions below to set a meaningful context and capture navigation breadcrumbs in your Bugsnag events:.
Read more >
Introduction · Native Navigation
Native Navigation is a navigation library for the React Native platform. There are many navigation libraries in the React Native ecosystem. Native Navigation...
Read more >
Stand-alone Integration - Sygic | Bringing life to maps
The navigation may run as a separate application, but it is still fully controlled by the integrator's application. Android · Windows · Linux....
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