You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's also possible to nest `Group` components inside other `Group` components.
35
158
36
159
## Props
@@ -39,6 +162,26 @@ It's also possible to nest `Group` components inside other `Group` components.
39
162
40
163
Options to configure how the screens inside the group get presented in the navigator. It accepts either an object or a function returning an object:
41
164
165
+
<TabsgroupId="config"queryString="config">
166
+
<TabItemvalue="static"label="Static"default>
167
+
168
+
```js
169
+
constStack=createNativeStackNavigator({
170
+
screens: {},
171
+
groups: {
172
+
screenOptions: {
173
+
presentation:'modal',
174
+
},
175
+
screens: {
176
+
/* screens */
177
+
},
178
+
},
179
+
});
180
+
```
181
+
182
+
</TabItem>
183
+
<TabItemvalue="dynamic"label="Dynamic"default>
184
+
42
185
```js
43
186
<Stack.Group
44
187
screenOptions={{
@@ -49,8 +192,31 @@ Options to configure how the screens inside the group get presented in the navig
49
192
</Stack.Group>
50
193
```
51
194
195
+
</TabItem>
196
+
</Tabs>
197
+
52
198
When you pass a function, it'll receive the [`route`](route-object.md) and [`navigation`](navigation-object.md):
53
199
200
+
<TabsgroupId="config"queryString="config">
201
+
<TabItemvalue="static"label="Static"default>
202
+
203
+
```js
204
+
constStack=createNativeStackNavigator({
205
+
screens: {},
206
+
groups: {
207
+
screenOptions: ({ route, navigation }) => ({
208
+
title:route.params.title,
209
+
}),
210
+
screens: {
211
+
/* screens */
212
+
},
213
+
},
214
+
});
215
+
```
216
+
217
+
</TabItem>
218
+
<TabItemvalue="dynamic"label="Dynamic"default>
219
+
54
220
```js
55
221
<Stack.Group
56
222
screenOptions={({ route, navigation }) => ({
@@ -61,18 +227,41 @@ When you pass a function, it'll receive the [`route`](route-object.md) and [`nav
61
227
</Stack.Group>
62
228
```
63
229
230
+
</TabItem>
231
+
</Tabs>
232
+
64
233
These options are merged with the `options` specified in the individual screens, and the screen's options will take precedence over the group's options.
65
234
66
235
See [Options for screens](screen-options.md) for more details and examples.
67
236
68
237
### `navigationKey`
69
238
70
239
Optional key for a group of screens screen. If the key changes, all existing screens in this group will be removed (if used in a stack navigator) or reset (if used in a tab or drawer navigator):
0 commit comments