react-native-bottom-sheet
react-native-bottom-sheet copied to clipboard
[v4] BottomSheetModal Portal not working
Bug
We have a setup that is using BottomSheet
where BottomSheetModal
is better suited. However, the Portal setup does not work with BottomSheetModal
- it does however work correctly with BottomSheet
.
Quick example of setup;
// BottomSheetComponent.tsx
const Port = ({ children }) => (
<Portal hostName="authenticated">{children}</Portal> // Portal "authenticated" is defined in our Authenticated stack to make sure Modals (from React Navigation) can take priority over BottomSheet/BottomSheetModal
)
...
return (
<Port>
<BottomSheet
ref={bottomSheetRef}
index={-1}
enableDynamicSizing
backdropComponent={renderBackdrop}
onChange={handleChange}
snapPoints={snapPoints}
>
....
</BottomSheet>
</Port>
)
Using BottomSheetModal means we don't have to have the snap points, otherwise they seem to be required and the bottom sheet isn't properly dismissible.
With this example, if we switch out BottomSheet for BottomSheetModal, the Portal does not have the desired effect.
Environment info
Library | Version |
---|---|
@gorhom/bottom-sheet | 4.6.4 |
react-native | 0.73.6 |
react-native-reanimated | 3.8.1 |
react-native-gesture-handler | 2.14.1 |
Steps To Reproduce
Describe what you expected to happen: