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-7.x/bottom-tab-navigator.md
+40-26
Original file line number
Diff line number
Diff line change
@@ -375,31 +375,7 @@ To show your screen under the tab bar, you can set the `position` style to absol
375
375
>
376
376
```
377
377
378
-
You also might need to add a bottom margin to your content if you have a absolutely positioned tab bar. React Navigation won't do it automatically.
379
-
380
-
To get the height of the bottom tab bar, you can use `BottomTabBarHeightContext` with [React's Context API](https://reactjs.org/docs/context.html#contextconsumer) or `useBottomTabBarHeight`:
You also might need to add a bottom margin to your content if you have an absolutely positioned tab bar. React Navigation won't do it automatically. See [`useBottomTabBarHeight`](#usebottomtabbarheight) for more details.
403
379
404
380
#### `tabBarBackground`
405
381
@@ -420,7 +396,7 @@ import { BlurView } from 'expo-blur';
420
396
>
421
397
```
422
398
423
-
When using `BlurView`, make sure to set `position: 'absolute'` in `tabBarStyle` as well. You'd also need to use `useBottomTabBarHeight()` to add a bottom padding to your content.
399
+
When using `BlurView`, make sure to set `position: 'absolute'` in `tabBarStyle` as well. You'd also need to use [`useBottomTabBarHeight`](#usebottomtabbarheight) to add a bottom padding to your content.
424
400
425
401
#### `tabBarPosition`
426
402
@@ -581,6 +557,44 @@ Navigates to an existing screen in the tab navigator. The method accepts followi
581
557
navigation.jumpTo('Profile', { owner:'Michaś' });
582
558
```
583
559
560
+
### Hooks
561
+
562
+
The bottom tab navigator exports the following hooks:
563
+
564
+
#### `useBottomTabBarHeight`
565
+
566
+
This hook returns the height of the bottom tab bar. By default, the screen content doesn't go under the tab bar. However, if you want to make the tab bar absolutely positioned and have the content go under it (e.g. to show a blur effect), it's necessary to adjust the content to take the tab bar height into account.
Alternatively, you can use the `BottomTabBarHeightContext` directly if you are using a class component or need it in a reusable component that can be used outside the bottom tab navigator:
Copy file name to clipboardExpand all lines: versioned_docs/version-7.x/material-top-tab-navigator.md
+28
Original file line number
Diff line number
Diff line change
@@ -517,3 +517,31 @@ Navigates to an existing screen in the tab navigator. The method accepts followi
517
517
```js
518
518
navigation.jumpTo('Profile', { name:'Michaś' });
519
519
```
520
+
521
+
### Hooks
522
+
523
+
The material top tab navigator exports the following hooks:
524
+
525
+
#### `useTabAnimation`
526
+
527
+
This hook returns an object containing an animated value that represents the current position of the tabs. This can be used to animate elements based on the swipe position of the tabs, such as the tab indicator:
Copy file name to clipboardExpand all lines: versioned_docs/version-7.x/native-stack-navigator.md
+30
Original file line number
Diff line number
Diff line change
@@ -805,3 +805,33 @@ Pops all of the screens in the stack except the first one and navigates to it.
805
805
```js
806
806
navigation.popToTop();
807
807
```
808
+
809
+
### Hooks
810
+
811
+
The native stack navigator exports the following hooks:
812
+
813
+
#### `useAnimatedHeaderHeight`
814
+
815
+
The hook returns an animated value representing the height of the header. This is similar to [`useHeaderHeight`](elements.md#useheaderheight) but returns an animated value that changed as the header height changes, e.g. when expanding or collapsing large title or search bar on iOS.
816
+
817
+
It can be used to animated content along with header height changes.
0 commit comments