Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6287

When i try using nested navigators it doesn't work on web (Reactive Native)

$
0
0

I'm new to react native and started learning about nested navigators.I tried to have the drawer and the stack navigator at the same time, but when i try it only works when i see the project on mobile, on web it's all blank.I can see the page appearing for a millisecond before it vanishes whenever i make a change to the code and hit save.

I've already read the documentations about it and watched some videos but nothing works.

Here's a simplified code of my index.tsx:

const Drawer = createDrawerNavigator();const Home=()=>{    return(<NavigationContainer><Drawer.Navigator drawerContent={props => <CustomDrawerContent {...props}/>} initialRouteName="Main Menu"><Drawer.Screen name="Main Menu" component={StackMainMenu}/></Drawer.Navigator></NavigationContainer>    )}const Stack = createStackNavigator();const StackMainMenu = ()=>(<Stack.Navigator><Stack.Screen name="Main Menu" component={MainMenu}/></Stack.Navigator>);

It works perfectly when seeing it on my phone, i can see the top bar and i can slide the drawer menu, on web it shows only a white page.

I also get this warning when compiling: Attempted import error: 'shouldUseActivityState' is not exported from 'react-native-screens'. maybe it has something to do?

Aditional information if it helps:

I'm using expo.I type npm start to launch the code.Using google chrome for web testing and android for mobile.I'm using Linux Mint


Viewing all articles
Browse latest Browse all 6287

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>