-
-
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.
Reformat part of test examples in TestsExample app
- Loading branch information
Showing
20 changed files
with
344 additions
and
221 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,50 @@ | ||
import * as React from 'react'; | ||
import {Button} from 'react-native'; | ||
import {NavigationContainer, ParamListBase} from '@react-navigation/native'; | ||
import {createNativeStackNavigator, NativeStackNavigationProp, useHeaderHeight} from 'react-native-screens/native-stack'; | ||
import { | ||
createNativeStackNavigator, | ||
NativeStackNavigationProp, | ||
useHeaderHeight, | ||
} from 'react-native-screens/native-stack'; | ||
|
||
const Stack = createNativeStackNavigator(); | ||
|
||
export default function App() { | ||
return ( | ||
<NavigationContainer> | ||
<Stack.Navigator screenOptions={{stackPresentation: 'formSheet', headerShown: false}}> | ||
<Stack.Navigator | ||
screenOptions={{stackPresentation: 'formSheet', headerShown: false}}> | ||
<Stack.Screen name="First" component={First} /> | ||
<Stack.Screen | ||
name="Second" | ||
component={Second} | ||
/> | ||
<Stack.Screen name="Second" component={Second} /> | ||
</Stack.Navigator> | ||
</NavigationContainer> | ||
); | ||
} | ||
|
||
function First({navigation}: {navigation: NativeStackNavigationProp<ParamListBase>}) { | ||
function First({ | ||
navigation, | ||
}: { | ||
navigation: NativeStackNavigationProp<ParamListBase>; | ||
}) { | ||
console.log(useHeaderHeight()); | ||
return ( | ||
<Button title="Tap me for second screen" onPress={() => navigation.navigate('Second')} /> | ||
|
||
<Button | ||
title="Tap me for second screen" | ||
onPress={() => navigation.navigate('Second')} | ||
/> | ||
); | ||
} | ||
|
||
function Second({navigation}: {navigation: NativeStackNavigationProp<ParamListBase>}) { | ||
function Second({ | ||
navigation, | ||
}: { | ||
navigation: NativeStackNavigationProp<ParamListBase>; | ||
}) { | ||
console.log(useHeaderHeight()); | ||
return ( | ||
<Button title="Tap me for first screen" onPress={() => navigation.navigate('First')} /> | ||
<Button | ||
title="Tap me for first screen" | ||
onPress={() => navigation.navigate('First')} | ||
/> | ||
); | ||
} | ||
|
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
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
Oops, something went wrong.