This repository was archived by the owner on May 8, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +26
-19
lines changed Expand file tree Collapse file tree 3 files changed +26
-19
lines changed Original file line number Diff line number Diff line change 1
- let stack = Stack . render;
1
+ let stack = StackExample . render;
2
2
let tab = TabExample . render;
3
3
let drawer = DrawerExample . render;
4
4
5
- module Switch =
6
- SwitchNavigator . Create ({
7
- open SwitchNavigator ;
8
-
9
- type route = Config . loginRoute ;
10
- let initialRoute = Login ;
11
-
12
- let getScreen = (route, navigation) =>
13
- switch (route) {
14
- | Login => (<Login navigation />, screenOptions() )
15
- | LoggedIn => (<LoggedIn navigation />, screenOptions() )
16
- };
17
- });
18
-
19
- let switchNavigator = Switch . render;
5
+ let switchNavigator = SwitchExample . render;
20
6
21
7
let app = drawer;
Original file line number Diff line number Diff line change @@ -7,7 +7,6 @@ open BsReactNavigation;
7
7
open Config ;
8
8
9
9
module Stack =
10
-
11
10
StackNavigator . Create ({
12
11
open StackNavigator ;
13
12
@@ -21,7 +20,6 @@ module Stack =
21
20
*/
22
21
let initialRoute = Home ;
23
22
24
-
25
23
/**
26
24
* Returns a screen for a given route and its options.
27
25
*
@@ -37,7 +35,7 @@ module Stack =
37
35
<Screen navigation text= {"Browsing profile of: " ++ userId} />,
38
36
screenOptions(~title= "Hello " ++ userId, () ),
39
37
)
40
- | TabExample => (<TabExample navigation/>, screenOptions() )
38
+ | TabExample => (<TabExample navigation />, screenOptions() )
41
39
};
42
40
});
43
41
Original file line number Diff line number Diff line change
1
+ open BsReactNavigation ;
2
+
3
+ /**
4
+ * Route and Navigation types are kept in a separate module to
5
+ * handle circular references between modules
6
+ */
7
+ open Config ;
8
+
9
+ module Switch =
10
+ SwitchNavigator . Create ({
11
+ open SwitchNavigator ;
12
+
13
+ type route = Config . loginRoute ;
14
+ let initialRoute = Login ;
15
+
16
+ let getScreen = (route, navigation) =>
17
+ switch (route) {
18
+ | Login => (<Login navigation />, screenOptions() )
19
+ | LoggedIn => (<LoggedIn navigation />, screenOptions() )
20
+ };
21
+ });
22
+
23
+ let render = Switch . render;
You can’t perform that action at this time.
0 commit comments