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
The `NavigationProvider` provides the [navigation object](navigation-object.md) and [route object](route-object.md) to components rendered outside of a screen.
9
8
10
-
`NavigationContext` provides the `navigation` object (same object as the [navigation](navigation-object.md) prop). In fact, [useNavigation](use-navigation.md) uses this context to get the `navigation` prop.
9
+
Most of the time, you don't need to use this directly. Screens and various built-in components such as headers are automatically provided with the navigation and route objects.
11
10
12
-
Most of the time, you won't use `NavigationContext` directly, as the provided `useNavigation` covers most use cases. But just in case you have something else in mind, `NavigationContext` is available for you to use.
11
+
## Providing navigation and route
13
12
14
-
Example:
13
+
Use `NavigationProvider` when you already have `navigation` and `route` objects and need to make them available to a component that doesn't normally have access to them:
For most cases, you should use the [`useNavigation`](use-navigation.md) and [`useRoute`](use-route.md) hooks to access the navigation and route objects. They work in screens rendered in a navigator, or components wrapped in a `NavigationProvider`.
43
+
44
+
However, if you need access to the contexts directly for any reason, you can use `NavigationContext` and `NavigationRouteContext` to access the navigation and route objects from the immediate parent screen or `NavigationProvider`:
Copy file name to clipboardExpand all lines: versioned_docs/version-8.x/drawer-navigator.md
+4-7Lines changed: 4 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -448,6 +448,10 @@ drawerItemStyle: {
448
448
},
449
449
```
450
450
451
+
#### `drawerItemTestID`
452
+
453
+
ID to locate the drawer item in tests.
454
+
451
455
#### `drawerLabelStyle`
452
456
453
457
Style object to apply to the `Text` style inside content section which renders a label.
@@ -657,13 +661,6 @@ Minimum swipe distance threshold that should activate opening the drawer.
657
661
658
662
Whether the keyboard should be dismissed when the swipe gesture begins. Defaults to `'on-drag'`. Set to `'none'` to disable keyboard handling.
659
663
660
-
#### `freezeOnBlur`
661
-
662
-
Boolean indicating whether to prevent inactive screens from re-rendering. Defaults to `false`.
663
-
Defaults to `true` when `enableFreeze()` from `react-native-screens` package is run at the top of the application.
664
-
665
-
Only supported on iOS and Android.
666
-
667
664
#### `popToTopOnBlur`
668
665
669
666
Boolean indicating whether any nested stack should be popped to the top of the stack when navigating away from this drawer screen. Defaults to `false`.
Copy file name to clipboardExpand all lines: versioned_docs/version-8.x/elements.md
+59-8Lines changed: 59 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -178,7 +178,7 @@ It receives an object containing following properties:
178
178
-`tintColor`: The color of the icon and label.
179
179
-`pressColor`: The color of the material ripple (Android >= 5.0 only).
180
180
-`pressOpacity`: The opacity of the button when it's pressed (Android < 5.0, and iOS).
181
-
-`displayMode`: How the element displays icon and title. Defaults to `default` on iOS and `minimal` on Android. Possible values:
181
+
-`displayMode`: How the element displays icon and title. Defaults to `default` on iOS 25 and below, and `minimal` on iOS 26 and above and Android. Possible values:
182
182
-`default`: Displays one of the following depending on the available space: previous screen's title, generic title (e.g. 'Back') or no title (only icon).
183
183
-`generic`: Displays one of the following depending on the available space: generic title (e.g. 'Back') or no title (only icon). iOS >= 14 only, falls back to "default" on older iOS versions.
184
184
-`minimal`: Always displays only the icon without a title.
@@ -373,7 +373,7 @@ Customize the style for the container of the `headerLeft` component, for example
373
373
374
374
Whether the liquid glass background is visible for the item.
375
375
376
-
Only supported on iOS 26.0 and later. Older versions of iOS and other platforms never show the background.\
376
+
Only supported on iOS 26.0 and later. Older versions of iOS and other platforms never show the background.
377
377
378
378
Defaults to `true`.
379
379
@@ -413,6 +413,35 @@ Note that if you don't want your content to appear under the header, you need to
413
413
414
414
To get the height of the header, you can use [`HeaderHeightContext`](#headerheightcontext) with [React's Context API](https://react.dev/reference/react/useContext#contextconsumer) or [`useHeaderHeight`](#useheaderheight).
415
415
416
+
#### `headerBlurEffect`
417
+
418
+
Blur effect for the transparent header on Web. The `headerTransparent` option needs to be set to `true` for this to work.
419
+
420
+
Supported values:
421
+
422
+
-`extraLight`
423
+
-`light`
424
+
-`regular`
425
+
-`prominent`
426
+
-`systemUltraThinMaterial`
427
+
-`systemThinMaterial`
428
+
-`systemMaterial`
429
+
-`systemThickMaterial`
430
+
-`systemChromeMaterial`
431
+
-`systemUltraThinMaterialLight`
432
+
-`systemThinMaterialLight`
433
+
-`systemMaterialLight`
434
+
-`systemThickMaterialLight`
435
+
-`systemChromeMaterialLight`
436
+
-`dark`
437
+
-`systemUltraThinMaterialDark`
438
+
-`systemThinMaterialDark`
439
+
-`systemMaterialDark`
440
+
-`systemThickMaterialDark`
441
+
-`systemChromeMaterialDark`
442
+
443
+
Only supported on Web.
444
+
416
445
#### `headerBackground`
417
446
418
447
Function which returns a React Element to render as the background of the header. This is useful for using backgrounds such as an image or a gradient.
@@ -621,17 +650,14 @@ A component used to show the back button header. It's the default for [`headerLe
621
650
-`pressColor` - Color for material ripple (Android >= 5.0 only).
622
651
-`icon` - Icon to display custom icon in header's back button. See [Custom back icon](#custom-back-icon) section for more details.
623
652
-`tintColor` - Tint color for the header.
624
-
-`label` - Label text for the button. Usually the title of the previous screen. By default, this is only shown on iOS.
653
+
-`label` - Label text for the button. Usually the title of the previous screen. By default, this is only shown on iOS 25 and below.
625
654
-`truncatedLabel` - Label text to show when there isn't enough space for the full label.
626
-
-`displayMode`: How the back button displays icon and title. Defaults to `default` on iOS and `minimal` on Android. Possible values:
655
+
-`displayMode`: How the back button displays icon and title. Defaults to `default` on iOS 25 and below, and `minimal` on iOS 26 and above and Android. Possible values:
627
656
-`default`: Displays one of the following depending on the available space: previous screen's title, generic title (e.g. 'Back') or no title (only icon).
628
657
-`generic`: Displays one of the following depending on the available space: generic title (e.g. 'Back') or no title (only icon). iOS >= 14 only, falls back to "default" on older iOS versions.
629
658
-`minimal`: Always displays only the icon without a title.
630
659
-`labelStyle` - Style object for the label.
631
660
-`allowFontScaling` - Whether label font should scale to respect Text Size accessibility settings.
632
-
-`onLabelLayout` - Callback to trigger when the size of the label changes.
633
-
-`screenLayout` - Layout of the screen.
634
-
-`titleLayout` - Layout of the title element in the header.
635
661
-`canGoBack` - Boolean to indicate whether it's possible to navigate back in stack.
636
662
-`accessibilityLabel` - Accessibility label for the button for screen readers.
637
663
-`testID` - ID to locate this button in tests.
@@ -702,7 +728,9 @@ A component that renders a button. In addition to [`PlatformPressable`](#platfor
702
728
-`plain`
703
729
-`filled`
704
730
-`color` - Color of the button. Defaults to the [theme](themes.md)'s primary color.
705
-
-`children` - Content to render inside the button.
731
+
-`icon` - Icon to display before the label. It can be an icon object or a function that returns an icon object or a React element. See [Icons](icons.md) for more details.
732
+
-`disabled` - Boolean which controls whether the button is disabled.
733
+
-`children` - Content to render inside the button. It must be a string or React element that can be nested inside a `Text` component.
706
734
707
735
In addition, the button integrates with React Navigation and accepts the same props as [`useLinkProps`](use-link-props.md#options) hook.
Copy file name to clipboardExpand all lines: versioned_docs/version-8.x/material-top-tab-navigator.md
-10Lines changed: 0 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -163,16 +163,6 @@ Possible values:
163
163
164
164
Only supported on Android.
165
165
166
-
#### `initialLayout`
167
-
168
-
Object containing the initial height and width of the screens. Passing this will improve the initial rendering performance. For most apps, this is a good default:
@@ -551,7 +553,7 @@ Preloading a screen means that the screen will be rendered in the background. Al
551
553
552
554
Depending on the navigator, `preload` may work differently:
553
555
554
-
- In a stack navigator ([stack](stack-navigator.md), [native stack](native-stack-navigator.md)), the screen will be rendered off-screen and animated in when you navigate to it. If [`getId`](screen.md#id) is specified, it'll be used for the navigation to identify the preloaded screen.
556
+
- In a stack navigator ([stack](stack-navigator.md), [native stack](native-stack-navigator.md)), the screen will be rendered off-screen and animated in when you navigate to it. If [`getId`](screen.md#id) is specified, it'll be used for the navigation to identify the preloaded screen.When`reuse` is `true`, a matching preloaded or existing route will be reused and its params will be updated.
555
557
- In a tab or drawer navigator ([bottom tabs](bottom-tab-navigator.md), [material top tabs](material-top-tab-navigator.md), [drawer](drawer-navigator.md), etc.), the existing screen will be rendered as if`lazy` was set to `false`. Calling`preload` on a screen that is already rendered will not have any effect.
0 commit comments