[v4] BottomSheetModal in react navigation modal
See original GitHub issueBug
The sheet is placed behind the @react-navigation/native modal.
Environment info
| Library | Version |
|---|---|
| @gorhom/bottom-sheet | 4.1.5 |
| react-native | 0.67.2 |
| react-native-reanimated | 2.3.1 |
| react-native-gesture-handler | 2.2.0 |
Steps To Reproduce
- Create a NativeStack
- Place the BottomSheetModalProvider like this:
<NavigationContainer>
<BottomSheetModalProvider>
<StackNavigator />
</BottomSheetModalProvider>
</NavigationContainer>
- Use the
<BottomSheetModal>in a screen withpresentation: "modal".
Describe what you expected to happen:
The sheet is placed behind the modal. I expect the sheet to be in front of the modal that hosts the sheet. I’ve also tried wrapping the modal-component with the provider, but then I get 'BottomSheetModalInternalContext' cannot be null!.
Reproducible sample code
The snack template throws an error: Cannot convert undefined or null to object
Issue Analytics
- State:
- Created 2 years ago
- Reactions:4
- Comments:15
Top Results From Across the Web
React Navigation Integration | React Native Bottom Sheet
React Navigation Integration. One of the main goal of this library, is to allow user to fully integrate a stack navigator in the...
Read more >Opening a modal - React Navigation
A modal displays content that temporarily blocks interactions with the main view. A modal is like a popup — it's not part of...
Read more >gorhom/bottom-sheet - npm
Modal presentation view, Bottom Sheet Modal. Smooth gesture interactions & snapping animations. Seamless keyboard handling for iOS & Android.
Read more >How to display a bottom sheet from React navigation ...
in const MainStack = createStackNavigator(); to open a Modal component. But it have a little bit lag, show a white background for about...
Read more >How to create bottom sheet / modal like this one? (read first ...
After updating I get the following error: "react native version mismatch, JS version: 0.61.4, Native version: 0.59.8"I tried looking online for a solution...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Adding a
<PortalProvider>to the root of my app seemed to interfere with the<BottomSheetModalProvider>that was already there (which already uses PortalProvider under the hood). Only every other bottom sheet I opened would become visible.I got mine working simply by wrapping my react-navigation modal screen’s contents in a
<BottomSheetModalProvider>:I don’t want to drop the benefits of using the native stack for this purpose. Thanks though.