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

react-navigation swipe to go back doesn't trigger

$
0
0

I am using stack navigation and I want to use swipe to go back. However, even when I swipe the screen all the way to the right the app doesn't navigate to the previous screen and the screen slides back.

import { View } from 'react-native';import Main from './components/Main'import Options from './components/Options'import 'react-native-gesture-handler';import { NavigationContainer } from '@react-navigation/native';import { createStackNavigator } from '@react-navigation/stack';const Stack = createStackNavigator();export default function App() {  return (<NavigationContainer><View><Stack.Navigator initialRouteName="Main" screenOptions={{ gestureResponseDistance: {horizontal: 20}}}><Stack.Screen name="MainScreen" component={Main} options={{ headerShown: false }}/><Stack.Screen name="OptionsScreen" component={Options} options={{ headerShown: false }}/></Stack.Navigator></View></NavigationContainer>  );}

To be clear I am able to swipe the screen but once I let go of my finger the screen slides back to its initial position and I am not able trigger swipe to go back no matter how fast I swipe.


Viewing all articles
Browse latest Browse all 16552

Trending Articles



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