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

How to call function instead of screen inside Drawer on React Navigation?

$
0
0

I Used "react-navigation": "^4.0.10", "react-navigation-drawer": "^2.3.2",

and implement a drawer and inside them, I added my item, one of them is "Call us" and it should open a phone so I used for it Linking and I don't know if that's a good way to invoke a function instead of Screen as default in RN-drawer

so I do that's But after click to this item my app crashed and stop to work!! so how can I achieve this?

const DrawerNavigator = createDrawerNavigator({
 ...
 CallUsDrawer: {
      screen: () => Linking.openURL(`tel:0597093830`),
      navigationOptions: {
        drawerLabel: 'call us',
        drawerIcon: () => <Icon name="ios-call" size={28} color="#1E558E" />,
      },
    },
 ...
}); 

Viewing all articles
Browse latest Browse all 28479

Trending Articles



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