Skip to content

Instantly share code, notes, and snippets.

@Yassir4
Last active March 29, 2022 11:07
Show Gist options
  • Save Yassir4/746fd6e032d0fa2da9459319bf16d521 to your computer and use it in GitHub Desktop.
Save Yassir4/746fd6e032d0fa2da9459319bf16d521 to your computer and use it in GitHub Desktop.
Adding portalProvider and portal host to the root component
function App() {
return (
<NavigationContainer>
<PortalProvider>
{/* view wrapper to fix the menu display in android */}
<View style={{flex: 1}}>
{/* our menu portal Host */}
<PortalHost name="menu" />
<Stack.Navigator>
<Stack.Screen name="Home" component={HomeScreen} />
</Stack.Navigator>
</View>
</PortalProvider>
</NavigationContainer>
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment