-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.tsx
31 lines (27 loc) · 948 Bytes
/
App.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import * as React from 'react';
import {NavigationContainer} from '@react-navigation/native';
import {createNativeStackNavigator} from 'react-native-screens/native-stack';
import HomeScreen from './src/scenes/Home';
import MaskedViewScreen from './src/scenes/MaskedView';
import {Button} from 'react-native';
const Stack = createNativeStackNavigator();
function App() {
return (
<NavigationContainer>
<Stack.Navigator>
<Stack.Screen name="Home" component={HomeScreen} />
<Stack.Screen
name="MaskedView"
component={MaskedViewScreen}
options={({navigation}) => ({
// Usage of custom 'headerLeft' breaks the app if MaskedView is rendered on the screen
headerLeft: () => (
<Button onPress={() => navigation.goBack()} title="Back" />
),
})}
/>
</Stack.Navigator>
</NavigationContainer>
);
}
export default App;