-
-
Notifications
You must be signed in to change notification settings - Fork 514
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add swipe direction on iOS (#1260)
Added swipeDirection prop on iOS. Requested in #946 When using `vertical` option, options `fullScreenSwipeEnabled: true`, `customAnimationOnSwipe: true` and `stackAnimation: 'slide_from_bottom'` are set by default. Co-authored-by: kacperkapusciak <kacper.kapusciak@swmansion.com>
- Loading branch information
1 parent
e27baec
commit f2ac36b
Showing
11 changed files
with
156 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import * as React from 'react'; | ||
import {Button, View} from 'react-native'; | ||
import {NavigationContainer, ParamListBase} from '@react-navigation/native'; | ||
import {createNativeStackNavigator, NativeStackNavigationProp} from 'react-native-screens/native-stack'; | ||
|
||
const Stack = createNativeStackNavigator(); | ||
|
||
export default function App() { | ||
return ( | ||
<NavigationContainer> | ||
<Stack.Navigator screenOptions={{swipeDirection: 'vertical'}}> | ||
<Stack.Screen name="First" component={First} /> | ||
<Stack.Screen | ||
name="Second" | ||
component={Second} | ||
/> | ||
</Stack.Navigator> | ||
</NavigationContainer> | ||
); | ||
} | ||
|
||
function First({navigation}: {navigation: NativeStackNavigationProp<ParamListBase>}) { | ||
return ( | ||
<View style={{flex: 1, backgroundColor: 'red'}}> | ||
<Button title="Tap me for second screen" onPress={() => navigation.navigate('Second')} /> | ||
</View> | ||
|
||
); | ||
} | ||
|
||
function Second({navigation}: {navigation: NativeStackNavigationProp<ParamListBase>}) { | ||
return ( | ||
<View style={{flex: 1, backgroundColor: 'blue'}}> | ||
<Button title="Tap me for second screen" onPress={() => navigation.navigate('First')} /> | ||
</View> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters