I have an App with a TabNavigator and in one of the Tab screens I display a BottomSheetModal. The provider for this BottomSheetModal is in the same screen, since I want the model to be displayed behind the TabBar.
But I also have a Portal in the model which I want to display above the TabBar, so I placed my PortalProvider and PortalHost outside of the screen above my TabNavigator, notably above the BottomSheetModalProvider.
When the Portal has no custom hostname it uses the BottomSheetModalProvider as the PortalProvider, which I expected, since BottomSheetModalProvider wraps a PortalProvider.
But when a hostName is specified (see example below) the Portal is not displayed at all, like the PortalHost couldn't be found. So it skips the BottomSheetModalProvider but does not find the PortalHost above it.
<App>
<PortalProvider>
<TabNavigator>
<TabScreen/>
<TabNavigator/>
<PortalHost name="AboveTabBar" />
An example screen in the TabNavigator:
const TabScreen = () => {
return (
<BottomSheetModalProvider>
<Portal hostName="AboveTabBar">
<Text>test</Text>
</Portal>
<BottomSheetModal>
...
</BottomSheetModal>
</BottomSheetModalProvider>
)
}
Could this be fixed by using a custom hostName inside BottomSheetModalProvider, so that custom portals don't use that as the host?
I have an App with a
TabNavigatorand in one of the Tab screens I display aBottomSheetModal. The provider for thisBottomSheetModalis in the same screen, since I want the model to be displayed behind theTabBar.But I also have a
Portalin the model which I want to display above theTabBar, so I placed myPortalProviderandPortalHostoutside of the screen above myTabNavigator, notably above theBottomSheetModalProvider.When the
Portalhas no custom hostname it uses theBottomSheetModalProvideras thePortalProvider, which I expected, sinceBottomSheetModalProviderwraps aPortalProvider.But when a hostName is specified (see example below) the Portal is not displayed at all, like the
PortalHostcouldn't be found. So it skips theBottomSheetModalProviderbut does not find thePortalHostabove it.An example screen in the
TabNavigator:Could this be fixed by using a custom
hostNameinsideBottomSheetModalProvider, so that custom portals don't use that as the host?