SHARE
TWEET

Untitled

a guest Jun 25th, 2019 49 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const MainTabNavigator = createBottomTabNavigator({
  2.     Home,
  3.     Tenants,
  4.     WorkOrders: {
  5.       screen: WorkOrders,
  6.       navigationOptions: {
  7.         title: 'Work Orders',
  8.         headerTitle: 'Work Orders'
  9.       }
  10.     }
  11. }, {
  12.   navigationOptions: ({ navigation }) => {
  13.       const { routeName } = navigation.state.routes[navigation.state.index];
  14.       return {
  15.         headerTitle: routeName
  16.       };
  17.   }
  18. });
  19.  
  20. const MainStackNavigator = createStackNavigator({
  21.     MainTabNavigator
  22. }, {
  23.   defaultNavigationOptions: ({ navigation }) => {
  24.       return {
  25.         headerLeft: (
  26.           <Icon
  27.             style={{ paddingLeft: 10 }}
  28.             onPress={() => navigation.openDrawer()}
  29.             name="md-menu"
  30.             size={30}
  31.           />
  32.         )
  33.       };
  34.     }
  35. });
  36.  
  37. const AppDrawerNavigator = createDrawerNavigator({
  38.   Menu: {
  39.     screen: MainStackNavigator
  40.   }
  41. });
  42.  
  43. const AppSwitchNavigator = createSwitchNavigator({
  44.   Login: { screen: Login },
  45.   Main: { screen: AppDrawerNavigator }
  46. });
  47.      
  48. async
  49. ...
  50. console.debug(response.data);  // Here the console shows value 10
  51. NavigationService.navigate('Main', { userID: response.data });
  52.      
  53. const { navigation } = this.props;
  54. const userID = navigation.getParam('userID', '0');
  55. console.debug(userID); // HERE THE VALUE IS 0, BUT SHOULD BE 10
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top