|
|
@@ -29,8 +29,10 @@ Afterwards, the app is ready for user interaction. (Common gotcha: Be sure not t
|
|
29
|
29
|
```js
|
|
30
|
30
|
Navigation.events().registerAppLaunchedListener(() => {
|
|
31
|
31
|
Navigation.setRoot({
|
|
32
|
|
- component: {
|
|
33
|
|
- name: 'navigation.playground.WelcomeScreen'
|
|
|
32
|
+ root: {
|
|
|
33
|
+ component: {
|
|
|
34
|
+ name: 'navigation.playground.WelcomeScreen'
|
|
|
35
|
+ }
|
|
34
|
36
|
}
|
|
35
|
37
|
});
|
|
36
|
38
|
});
|
|
|
@@ -49,25 +51,27 @@ For all possible layout types see [API](/api/README).
|
|
49
|
51
|
|
|
50
|
52
|
```js
|
|
51
|
53
|
Navigation.setRoot({
|
|
52
|
|
- sideMenu: {
|
|
53
|
|
- left: {
|
|
54
|
|
- component: {
|
|
55
|
|
- name: 'navigation.playground.TextScreen',
|
|
56
|
|
- passProps: {
|
|
57
|
|
- text: 'This is a left side menu screen'
|
|
|
54
|
+ root: {
|
|
|
55
|
+ sideMenu: {
|
|
|
56
|
+ left: {
|
|
|
57
|
+ component: {
|
|
|
58
|
+ name: 'navigation.playground.TextScreen',
|
|
|
59
|
+ passProps: {
|
|
|
60
|
+ text: 'This is a left side menu screen'
|
|
|
61
|
+ }
|
|
58
|
62
|
}
|
|
59
|
|
- }
|
|
60
|
|
- },
|
|
61
|
|
- center: {
|
|
62
|
|
- component: {
|
|
63
|
|
- name: 'navigation.playground.WelcomeScreen'
|
|
64
|
63
|
},
|
|
65
|
|
- },
|
|
66
|
|
- right: {
|
|
67
|
|
- component: {
|
|
68
|
|
- name: 'navigation.playground.TextScreen',
|
|
69
|
|
- passProps: {
|
|
70
|
|
- text: 'This is a right side menu screen'
|
|
|
64
|
+ center: {
|
|
|
65
|
+ component: {
|
|
|
66
|
+ name: 'navigation.playground.WelcomeScreen'
|
|
|
67
|
+ },
|
|
|
68
|
+ },
|
|
|
69
|
+ right: {
|
|
|
70
|
+ component: {
|
|
|
71
|
+ name: 'navigation.playground.TextScreen',
|
|
|
72
|
+ passProps: {
|
|
|
73
|
+ text: 'This is a right side menu screen'
|
|
|
74
|
+ }
|
|
71
|
75
|
}
|
|
72
|
76
|
}
|
|
73
|
77
|
}
|
|
|
@@ -79,27 +83,29 @@ Navigation.setRoot({
|
|
79
|
83
|
|
|
80
|
84
|
```js
|
|
81
|
85
|
Navigation.setRoot({
|
|
82
|
|
- bottomTabs: {
|
|
83
|
|
- children: [
|
|
84
|
|
- {
|
|
85
|
|
- component: {
|
|
86
|
|
- name: 'navigation.playground.TextScreen',
|
|
87
|
|
- passProps: {
|
|
88
|
|
- text: 'This is tab 1',
|
|
89
|
|
- myFunction: () => 'Hello from a function!',
|
|
|
86
|
+ root: {
|
|
|
87
|
+ bottomTabs: {
|
|
|
88
|
+ children: [
|
|
|
89
|
+ {
|
|
|
90
|
+ component: {
|
|
|
91
|
+ name: 'navigation.playground.TextScreen',
|
|
|
92
|
+ passProps: {
|
|
|
93
|
+ text: 'This is tab 1',
|
|
|
94
|
+ myFunction: () => 'Hello from a function!',
|
|
|
95
|
+ },
|
|
90
|
96
|
},
|
|
91
|
97
|
},
|
|
92
|
|
- },
|
|
93
|
|
- {
|
|
94
|
|
- component: {
|
|
95
|
|
- name: 'navigation.playground.TextScreen',
|
|
96
|
|
- passProps: {
|
|
97
|
|
- text: 'This is tab 2',
|
|
|
98
|
+ {
|
|
|
99
|
+ component: {
|
|
|
100
|
+ name: 'navigation.playground.TextScreen',
|
|
|
101
|
+ passProps: {
|
|
|
102
|
+ text: 'This is tab 2',
|
|
|
103
|
+ },
|
|
98
|
104
|
},
|
|
99
|
105
|
},
|
|
100
|
|
- },
|
|
101
|
|
- ],
|
|
102
|
|
- },
|
|
|
106
|
+ ],
|
|
|
107
|
+ },
|
|
|
108
|
+ }
|
|
103
|
109
|
});
|
|
104
|
110
|
```
|
|
105
|
111
|
|
|
|
@@ -107,32 +113,34 @@ Navigation.setRoot({
|
|
107
|
113
|
|
|
108
|
114
|
```js
|
|
109
|
115
|
Navigation.setRoot({
|
|
110
|
|
- stack: {
|
|
111
|
|
- options: {
|
|
112
|
|
- topBar: {
|
|
113
|
|
- hidden: true,
|
|
|
116
|
+ root: {
|
|
|
117
|
+ stack: {
|
|
|
118
|
+ options: {
|
|
|
119
|
+ topBar: {
|
|
|
120
|
+ hidden: true,
|
|
|
121
|
+ },
|
|
114
|
122
|
},
|
|
115
|
|
- },
|
|
116
|
|
- children: [
|
|
117
|
|
- {
|
|
118
|
|
- component: {
|
|
119
|
|
- name: 'navigation.playground.TextScreen',
|
|
120
|
|
- passProps: {
|
|
121
|
|
- text: 'This is tab 1',
|
|
122
|
|
- myFunction: () => 'Hello from a function!',
|
|
|
123
|
+ children: [
|
|
|
124
|
+ {
|
|
|
125
|
+ component: {
|
|
|
126
|
+ name: 'navigation.playground.TextScreen',
|
|
|
127
|
+ passProps: {
|
|
|
128
|
+ text: 'This is tab 1',
|
|
|
129
|
+ myFunction: () => 'Hello from a function!',
|
|
|
130
|
+ },
|
|
123
|
131
|
},
|
|
124
|
132
|
},
|
|
125
|
|
- },
|
|
126
|
|
- {
|
|
127
|
|
- component: {
|
|
128
|
|
- name: 'navigation.playground.TextScreen',
|
|
129
|
|
- passProps: {
|
|
130
|
|
- text: 'This is tab 2',
|
|
|
133
|
+ {
|
|
|
134
|
+ component: {
|
|
|
135
|
+ name: 'navigation.playground.TextScreen',
|
|
|
136
|
+ passProps: {
|
|
|
137
|
+ text: 'This is tab 2',
|
|
|
138
|
+ },
|
|
131
|
139
|
},
|
|
132
|
140
|
},
|
|
133
|
|
- },
|
|
134
|
|
- ],
|
|
135
|
|
- },
|
|
|
141
|
+ ],
|
|
|
142
|
+ },
|
|
|
143
|
+ }
|
|
136
|
144
|
});
|
|
137
|
145
|
```
|
|
138
|
146
|
|