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
@@ -704,14 +704,6 @@ It can also be a function that returns a React Element to render any component:
704
704
/>
705
705
```
706
706
707
-
### `MissingIcon`
708
-
709
-
A component that renders a missing icon symbol. It can be used as a fallback for icons to show that there's a missing icon. It accepts the following props:
710
-
711
-
-`color` - Color of the icon.
712
-
-`size` - Size of the icon.
713
-
-`style` - Additional styles for the icon.
714
-
715
707
### `PlatformPressable`
716
708
717
709
A component which provides an abstraction on top of [`Pressable`](https://reactnative.dev/docs/Pressable) to handle platform differences. In addition to `Pressable`'s props, it accepts following additional props:
@@ -816,16 +808,6 @@ Usage:
816
808
817
809
## Utilities
818
810
819
-
### `SafeAreaProviderCompat`
820
-
821
-
A wrapper over the `SafeAreaProvider` component from [`react-native-safe-area-context`](https://github.com/th3rdwave/react-native-safe-area-context) which includes initial values.
822
-
823
-
Usage:
824
-
825
-
```js
826
-
<SafeAreaProviderCompat>{/* Your components */}</SafeAreaProviderCompat>
827
-
```
828
-
829
811
### `HeaderBackContext`
830
812
831
813
React context that can be used to get the back title of the parent screen.
Copy file name to clipboardExpand all lines: versioned_docs/version-8.x/material-top-tab-navigator.md
+47-7Lines changed: 47 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -151,17 +151,57 @@ String indicating whether the keyboard gets dismissed in response to a drag gest
151
151
-`'on-drag'`: the keyboard is dismissed when a drag begins.
152
152
-`'none'`: drags do not dismiss the keyboard.
153
153
154
-
#### `overScrollMode`
154
+
#### `adapter`
155
155
156
-
Used to override default value of pager's overScroll mode.
156
+
Function that renders a custom adapter for rendering pages. By default, the material top tab navigator uses [`react-native-pager-view`](https://github.com/callstack/react-native-pager-view) for rendering pages on Android and iOS. However, it may not be suitable for all use cases.
157
157
158
-
Possible values:
158
+
You can use built-in adapters from [`react-native-tab-view`](tab-view.md#renderadapter) or create your own custom adapter.
159
159
160
-
-`'auto'` (default): Allow a user to over-scroll this view only if the content is large enough to meaningfully scroll.
161
-
-`'always'`: Always allow a user to over-scroll this view.
162
-
-`'never'`: Never allow a user to over-scroll this view.
160
+
To pass adapter-specific props, wrap the adapter in a function and forward the navigator props:
163
161
164
-
Only supported on Android.
162
+
```js name="Material Top Tab Navigator adapter" snack static2dynamic
`PagerViewAdapter` accepts props from [`react-native-pager-view`](https://github.com/callstack/react-native-pager-view), such as `overScrollMode` and `pageMargin`. `ScrollViewAdapter` accepts [scroll view](https://reactnative.dev/docs/scrollview) props such as `bounces`.
When using `vertical` option, options`fullScreenGestureEnabled: true`, `customAnimationOnGesture: true` and `animation: 'slide_from_bottom'` are set by default.
384
+
If you want the gesture to work on the whole screen or match a specific animation, configure`fullScreenGestureEnabled`, `customAnimationOnGesture`, and `animation` explicitly.
@@ -911,7 +917,7 @@ Preloading a screen means that the screen will be rendered in the background. Al
911
917
912
918
Depending on the navigator, `preload` may work slightly differently:
913
919
914
-
- 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.
920
+
- 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.
915
921
- 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.
Copy file name to clipboardExpand all lines: versioned_docs/version-8.x/static-configuration.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ The bulk of the static configuration is done using the `createXNavigator` functi
10
10
11
11
The `createXNavigator` functions take one argument, which is an object with the following properties:
12
12
13
-
- Same props as the navigator component, e.g. `id`, `initialRouteName`, `screenOptions` etc. See [Navigator](navigator.md) as well as the docs for each navigator for more details on the props they accept.
13
+
- Same props as the navigator component, e.g. `initialRouteName`, `screenOptions` etc. See [Navigator](navigator.md) as well as the docs for each navigator for more details on the props they accept.
14
14
-`screens` - an object containing configuration for each screen in the navigator.
15
15
-`groups` - an optional object containing groups of screens (equivalent to [`Group`](group.md) in the dynamic API).
@@ -452,25 +447,13 @@ String indicating whether the keyboard gets dismissed in response to a drag gest
452
447
-`'on-drag'`: the keyboard is dismissed when a drag begins.
453
448
-`'none'`: drags do not dismiss the keyboard.
454
449
455
-
##### `overScrollMode`
456
-
457
-
Used to override default value of pager's overScroll mode.
458
-
459
-
Possible values:
460
-
461
-
-`'auto'` (default): Allow a user to over-scroll this view only if the content is large enough to meaningfully scroll.
462
-
-`'always'`: Always allow a user to over-scroll this view.
463
-
-`'never'`: Never allow a user to over-scroll this view.
464
-
465
-
Only supported on Android.
466
-
467
450
##### `swipeEnabled`
468
451
469
452
Boolean indicating whether to enable swipe gestures. Swipe gestures are enabled by default. Passing `false` will disable swipe gestures, but the user can still switch tabs by pressing the tab bar.
470
453
471
454
##### `renderAdapter`
472
455
473
-
A function that returns a custom adapter for rendering pages. By default, `react-native-tab-view` uses [`react-native-pager-view`](https://github.com/callstack/react-native-pager-view) for rendering pages on Android and iOS. However, it may not be suitable for all use cases.
456
+
Function that renders a custom adapter for rendering pages. By default, `react-native-tab-view` uses [`react-native-pager-view`](https://github.com/callstack/react-native-pager-view) for rendering pages on Android and iOS. However, it may not be suitable for all use cases.
474
457
475
458
You can use built-in adapters or create your own custom adapter. For example, you can use `ScrollViewAdapter` to use a `ScrollView` for rendering pages:
476
459
@@ -498,6 +481,36 @@ The following built-in adapters are available:
498
481
-`PanResponderAdapter`: Uses [`PanResponder`](https://reactnative.dev/docs/panresponder) for handling gestures (default on Web and other platforms).
499
482
-`ScrollViewAdapter`: Uses [`ScrollView`](https://reactnative.dev/docs/scrollview) for rendering pages.
500
483
484
+
To pass adapter-specific props, wrap the adapter in a function and forward the `TabView` props:
`PagerViewAdapter` accepts props from [`react-native-pager-view`](https://github.com/callstack/react-native-pager-view), such as `overScrollMode` and `pageMargin`. `ScrollViewAdapter` accepts [scroll view](https://reactnative.dev/docs/scrollview) props such as `bounces`, `decelerationRate`, and `keyboardShouldPersistTaps`.
513
+
501
514
You can also create your own custom adapter by implementing the required interface:
0 commit comments