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
Copy file name to clipboardExpand all lines: versioned_docs/version-8.x/bottom-tab-navigator.md
+23-10Lines changed: 23 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -168,12 +168,6 @@ It supports the following values:
168
168
-`fullHistory` - return to last visited screen in the navigator; doesn't drop duplicate entries unlike `history` - this behavior is useful to match how web pages work
169
169
-`none` - do not handle back button
170
170
171
-
#### `detachInactiveScreens`
172
-
173
-
Boolean used to indicate whether inactive screens should be detached from the view hierarchy to save memory. This enables integration with [react-native-screens](https://github.com/software-mansion/react-native-screens). Defaults to `true`.
174
-
175
-
Only supported with `custom` implementation.
176
-
177
171
#### `tabBar`
178
172
179
173
Function that returns a React element to display as the tab bar.
@@ -316,6 +310,29 @@ function MyTabBar({ navigation }) {
316
310
317
311
The following [options](screen-options.md) can be used to configure the screens in the navigator. These can be specified under `screenOptions` prop of `Tab.Navigator` or `options` prop of `Tab.Screen`.
318
312
313
+
#### `inactiveBehavior`
314
+
315
+
This controls what should happen when screens become inactive.
316
+
317
+
It supports the following values:
318
+
319
+
-`pause`: Effects are cleaned up - e.g. timers are cleared, subscriptions are removed, etc. This avoids unnecessary renders when the screen is inactive.
320
+
-`none`: Screen renders normally.
321
+
322
+
Defaults to `pause`.
323
+
324
+
If you set [`lazy: false`](#lazy) or [`preload`](navigation-actions.md#preload) a screen, it won't be paused until after the first time it becomes focused. This makes sure that effects are run to initialize the screen.
325
+
326
+
:::info
327
+
328
+
React Navigation determines whether a screen is inactive based on various factors such as gestures, animations, and other interactions after it becomes unfocused.
329
+
330
+
:::
331
+
332
+
#### `lazy`
333
+
334
+
Whether this screen should render only after the first time it's accessed. Defaults to `true`. Set it to `false` if you want to render the screen on the initial render of the navigator.
335
+
319
336
#### `title`
320
337
321
338
Generic title that can be used as a fallback for `headerTitle` and `tabBarLabel`.
@@ -1026,10 +1043,6 @@ Defaults to `automatic` for each edge.
1026
1043
1027
1044
Only supported with `native` implementation on iOS 26 and above.
1028
1045
1029
-
#### `lazy`
1030
-
1031
-
Whether this screen should render only after the first time it's accessed. Defaults to `true`. Set it to `false` if you want to render the screen on the initial render of the navigator.
1032
-
1033
1046
#### `popToTopOnBlur`
1034
1047
1035
1048
Boolean indicating whether any nested stack should be popped to the top of the stack when navigating away from this tab. Defaults to `false`.
Copy file name to clipboardExpand all lines: versioned_docs/version-8.x/drawer-navigator.md
+15-6Lines changed: 15 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -132,10 +132,6 @@ The default status of the drawer - whether the drawer should stay `open` or `clo
132
132
133
133
When this is set to `open`, the drawer will be open from the initial render. It can be closed normally using gestures or programmatically. However, when going back, the drawer will re-open if it was closed. This is essentially the opposite of the default behavior of the drawer where it starts `closed`, and the back button closes an open drawer.
134
134
135
-
#### `detachInactiveScreens`
136
-
137
-
Boolean used to indicate whether inactive screens should be detached from the view hierarchy to save memory. This enables integration with [react-native-screens](https://github.com/software-mansion/react-native-screens). Defaults to `true`.
138
-
139
135
#### `drawerContent`
140
136
141
137
Function that returns React element to render as the content of the drawer, for example, navigation items
@@ -267,14 +263,27 @@ To use the custom component, we need to pass it in the `drawerContent` prop:
267
263
268
264
The following [options](screen-options.md) can be used to configure the screens in the navigator. These can be specified under `screenOptions` prop of `Drawer.Navigator` or `options` prop of `Drawer.Screen`.
269
265
270
-
#### `title`
266
+
#### `inactiveBehavior`
271
267
272
-
A generic title that can be used as a fallback for `headerTitle` and `drawerLabel`.
268
+
This controls what should happen when screens become inactive.
269
+
270
+
It supports the following values:
271
+
272
+
-`pause`: Effects are cleaned up - e.g. timers are cleared, subscriptions are removed, etc. This avoids unnecessary renders when the screen is inactive.
273
+
-`none`: Screen renders normally.
274
+
275
+
Defaults to `pause`.
276
+
277
+
If you set [`lazy: false`](#lazy) or [`preload`](navigation-actions.md#preload) a screen, it won't be paused until after the first time it becomes focused. This makes sure that effects are run to initialize the screen.
273
278
274
279
#### `lazy`
275
280
276
281
Whether this screen should render the first time it's accessed. Defaults to `true`. Set it to `false` if you want to render the screen on initial render.
277
282
283
+
#### `title`
284
+
285
+
A generic title that can be used as a fallback for `headerTitle` and `drawerLabel`.
286
+
278
287
#### `drawerLabel`
279
288
280
289
String or a function that given `{ focused: boolean, color: string }` returns a React.Node, to display in drawer sidebar. When undefined, scene `title` is used.
Copy file name to clipboardExpand all lines: versioned_docs/version-8.x/material-top-tab-navigator.md
+19Lines changed: 19 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -354,6 +354,25 @@ export default function App() {
354
354
}
355
355
```
356
356
357
+
#### `inactiveBehavior`
358
+
359
+
This controls what should happen when screens become inactive.
360
+
361
+
It supports the following values:
362
+
363
+
-`pause`: Effects are cleaned up - e.g. timers are cleared, subscriptions are removed, etc. This avoids unnecessary renders when the screen is inactive.
364
+
-`none`: Screen renders normally.
365
+
366
+
Defaults to `pause`.
367
+
368
+
If you set [`lazy: false`](#lazy) or [`preload`](navigation-actions.md#preload) a screen, it won't be paused until after the first time it becomes focused. This makes sure that effects are run to initialize the screen.
369
+
370
+
:::info
371
+
372
+
React Navigation determines whether a screen is inactive based on various factors such as gestures, animations, and other interactions after it becomes unfocused.
373
+
374
+
:::
375
+
357
376
#### `title`
358
377
359
378
Generic title that can be used as a fallback for `headerTitle` and `tabBarLabel`.
Copy file name to clipboardExpand all lines: versioned_docs/version-8.x/native-stack-navigator.md
+19Lines changed: 19 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -95,6 +95,25 @@ The native stack navigator accepts the [common props](navigator.md#configuration
95
95
96
96
The following [options](screen-options.md) can be used to configure the screens in the navigator:
97
97
98
+
#### `inactiveBehavior`
99
+
100
+
This controls what should happen when screens become inactive.
101
+
102
+
It supports the following values:
103
+
104
+
-`pause`: Effects are cleaned up - e.g. timers are cleared, subscriptions are removed, etc. This avoids unnecessary renders when the screen is inactive.
105
+
-`none`: Screen renders normally.
106
+
107
+
Defaults to `pause`.
108
+
109
+
If you [`preload`](navigation-actions.md#preload) a screen, it won't be paused until after the first time it becomes focused. This makes sure that effects are run to initialize the screen.
110
+
111
+
:::info
112
+
113
+
React Navigation determines whether a screen is inactive based on various factors such as gestures, animations, and other interactions after it becomes unfocused.
114
+
115
+
:::
116
+
98
117
#### `title`
99
118
100
119
String that can be used as a fallback for `headerTitle`.
Copy file name to clipboardExpand all lines: versioned_docs/version-8.x/stack-navigator.md
+17-15Lines changed: 17 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -110,19 +110,28 @@ export default function App() {
110
110
111
111
## API Definition
112
112
113
-
### Props
113
+
### Options
114
114
115
-
In addition to the [common props](navigator.md#configuration) shared by all navigators, the stack navigator accepts the following additional props:
115
+
The following [options](screen-options.md) can be used to configure the screens in the navigator. These can be specified under `screenOptions` prop of `Stack.Navigator` or `options` prop of `Stack.Screen`.
116
116
117
-
#### `detachInactiveScreens`
117
+
#### `inactiveBehavior`
118
118
119
-
Boolean used to indicate whether inactive screens should be detached from the view hierarchy to save memory. This enables integration with [react-native-screens](https://github.com/software-mansion/react-native-screens). Defaults to `true`.
119
+
This controls what should happen when screens become inactive.
120
120
121
-
If you need to disable this optimization for specific screens (e.g. you want to screen to stay in view even when unfocused) [`detachPreviousScreen`](#detachpreviousscreen) option.
121
+
It supports the following values:
122
122
123
-
### Options
123
+
-`pause`: Effects are cleaned up - e.g. timers are cleared, subscriptions are removed, etc. This avoids unnecessary renders when the screen is inactive.
124
+
-`none`: Screen renders normally.
124
125
125
-
The following [options](screen-options.md) can be used to configure the screens in the navigator. These can be specified under `screenOptions` prop of `Stack.Navigator` or `options` prop of `Stack.Screen`.
126
+
Defaults to `pause`.
127
+
128
+
If you [`preload`](navigation-actions.md#preload) a screen, it won't be paused until after the first time it becomes focused. This makes sure that effects are run to initialize the screen.
129
+
130
+
:::info
131
+
132
+
React Navigation determines whether a screen is inactive based on various factors such as gestures, animations, and other interactions after it becomes unfocused.
133
+
134
+
:::
126
135
127
136
#### `title`
128
137
@@ -144,7 +153,7 @@ Function which returns a React Element to display as the overlay for the card. M
144
153
145
154
Style object for the card in stack. You can provide a custom background color to use instead of the default background here.
146
155
147
-
You can also specify `{ backgroundColor: 'transparent' }` to make the previous screen visible underneath (for transparent modals). This is useful to implement things like modal dialogs. You should also specify `presentation: 'modal'` in the options when using a transparent background so previous screens aren't detached and stay visible underneath.
156
+
You can also specify `{ backgroundColor: 'transparent' }` to make the previous screen visible underneath (for transparent modals). This is useful to implement things like modal dialogs. You should also specify `presentation: 'modal'` in the options when using a transparent background so previous screens stay visible underneath.
148
157
149
158
On Web, the height of the screen isn't limited to the height of the viewport. This is by design to allow the browser's address bar to hide when scrolling. If this isn't desirable behavior, you can set `cardStyle` to `{ flex: 1 }` to force the screen to fill the viewport.
150
159
@@ -159,7 +168,6 @@ This is shortcut option which configures several options to configure the style
159
168
-`transparentModal`: Similar to `modal`. This changes following things:
160
169
- Sets `headerMode` to `screen` for the screen unless specified otherwise.
161
170
- Sets background color of the screen to transparent, so previous screen is visible
162
-
- Adjusts the `detachPreviousScreen` option so that the previous screen stays rendered.
163
171
- Prevents the previous screen from animating from its last position.
164
172
- Changes the screen animation to a vertical slide animation.
165
173
@@ -223,12 +231,6 @@ Interpolated styles for various parts of the header. Refer the [Animations secti
223
231
224
232
If `false`, the keyboard will NOT automatically dismiss when navigating to a new screen from this screen. Defaults to `true`.
225
233
226
-
#### `detachPreviousScreen`
227
-
228
-
Boolean used to indicate whether to detach the previous screen from the view hierarchy to save memory. Set it to `false` if you need the previous screen to be seen through the active screen. Only applicable if `detachInactiveScreens` isn't set to `false`.
229
-
230
-
This is automatically adjusted when using [`presentation`](#presentation) as `transparentModal` or `modal` to keep the required screens visible. Defaults to `true` in other cases.
231
-
232
234
#### `freezeOnBlur`
233
235
234
236
Boolean indicating whether to prevent inactive screens from re-rendering. Defaults to `false`.
0 commit comments