forked from react-navigation/experimental-transitioner
-
Notifications
You must be signed in to change notification settings - Fork 1
/
App.js
55 lines (47 loc) · 1.43 KB
/
App.js
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import React from "react";
import { View, Button } from "react-native";
import {
createSwitchNavigator,
createNavigationContainer,
} from "react-navigation";
import Fade from "./examples/Fade";
import Modal from "./examples/Modal";
import Gesture from "./examples/Gesture";
import CardStack from "./examples/CardStack";
import SharedEl from "./examples/SharedEl";
import { Provider as LayoutProvider } from "./LayoutContext";
process.env.REACT_NAV_LOGGING = true;
const Examples = ({ navigation }) => (
<View style={{ flex: 1, justifyContent: "center" }}>
{Object.keys(EXAMPLES).map(exampleName => (
<Button
key={exampleName}
onPress={() => navigation.navigate(exampleName)}
title={exampleName}
/>
))}
</View>
);
const EXAMPLES = {
Fade,
Modal,
Gesture,
CardStack,
SharedEl,
};
const AppNavigator = createSwitchNavigator({
Examples,
...EXAMPLES,
});
// const StatefulAppNavigator = createNavigationContainer(AppNavigator);
// const StatefulAppNavigator = createNavigationContainer(Fade);
// const StatefulAppNavigator = createNavigationContainer(Modal);
const StatefulAppNavigator = createNavigationContainer(Gesture);
// const StatefulAppNavigator = createNavigationContainer(CardStack);
// const StatefulAppNavigator = createNavigationContainer(SharedEl);
const App = () => (
<LayoutProvider style={{ flex: 1 }}>
<StatefulAppNavigator />
</LayoutProvider>
);
export default App;