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

How can I add an Alert on StackScreen

$
0
0

I have a question about this code, I want to add an Alert if you press the BackButton but only in 2 navigation screen (MARKETPLACE and SHOP)The Alert is to confirm is you want to back or cancel if notHow can I do that?My BackButton is the first Stack.ScreenThis is the code:

<Stack.Navigator><Stack.Screen  name='Root'  component={DrawerNavigator}  options={{  headerShown: false,  title: '',  headerBackTitle: 'BackButton  }}/><Stack.Screen options={{ title: 'MARKETPLACE' }} name='Marketplace' component={Marketplace} /><Stack.Screen options={{ title: 'SHOP' }} name='Shop' component={Shopping} /><Stack.Screen options={{ title: 'CHECKOUT' }} name='Checkout' component={Checkout} /><Stack.Screen options={{ title: 'CHECK' }} name='Check' component={CheckSuccess} /></Stack.Navigator>

Viewing all articles
Browse latest Browse all 6287

Trending Articles



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