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-6.x/native-stack-navigator.md
+13-3Lines changed: 13 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -144,13 +144,23 @@ Style object for header. Supported properties:
144
144
145
145
Whether to hide the elevation shadow (Android) or the bottom border (iOS) on the header.
146
146
147
-
#### `headerTranslucent`
147
+
#### `headerTransparent`
148
148
149
-
Boolean indicating whether the navigation bar is translucent. Setting this to `true` makes the header absolutely positioned, and changes the background color to `transparent` unless specified in `headerStyle`.
149
+
Boolean indicating whether the navigation bar is translucent.
150
+
151
+
Defaults to `false`. Setting this to `true` makes the header absolutely positioned - so that the header floats over the screen so that it overlaps the content underneath, and changes the background color to `transparent` unless specified in `headerStyle`.
152
+
153
+
This is useful if you want to render a semi-transparent header or a blurred background.
154
+
155
+
Note that if you don't want your content to appear under the header, you need to manually add a top margin to your content. React Navigation won't do it automatically.
156
+
157
+
To get the height of the header, you can use [`HeaderHeightContext`](elements.md#headerheightcontext) with [React's Context API](https://reactjs.org/docs/context.html#contextconsumer) or [`useHeaderHeight`](elements.md#useheaderheight).
150
158
151
159
#### `headerBlurEffect`
152
160
153
-
Blur effect for the translucent header. Supported values:
161
+
Blur effect for the translucent header. The `headerTransparent` option needs to be set to `true` for this to work.
Copy file name to clipboardExpand all lines: versioned_docs/version-6.x/pitch.md
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -8,16 +8,16 @@ It's useful when considering whether or not to use a project to understand the t
8
8
9
9
## Pitch
10
10
11
-
- React Navigation doesn't include any native code in the library itself, but we use many native libraries such as [Reanimated](https://software-mansion.github.io/react-native-reanimated/), [Gesture Handler](https://software-mansion.github.io/react-native-gesture-handler/), [Screens](https://github.com/software-mansion/react-native-screens) etc. to implement performant animations and gestures. Depending on the navigator, many UI components are written in JavaScript on top of React Native primitives. This has a lot of benefits:
11
+
- React Navigation doesn't include any native code in the library itself, but we use many native libraries such as [Screens](https://github.com/software-mansion/react-native-screens), [Reanimated](https://software-mansion.github.io/react-native-reanimated/), [Gesture Handler](https://software-mansion.github.io/react-native-gesture-handler/) etc. to implement performant animations and gestures. Depending on the navigator, many UI components are written in JavaScript on top of React Native primitives. This has a lot of benefits:
12
12
- Easy OTA updates
13
13
- Debuggable
14
14
- Customizable
15
-
- Most apps heavily customize navigation, to do this with an API that wraps native navigation you will need to write a lot of native code. In React Navigation, we provide navigators written fully with JavaScript (e.g. [Stack Navigator](stack-navigator.md)) and navigators implemented on top of platform navigation primitives (e.g. [Native Stack Navigator](https://github.com/software-mansion/react-native-screens/tree/master/native-stack)). This lets you pick the navigators suitable for your use case, depending on whether you want native platform behavior or full customizability.
16
-
- It's easy to write your own navigators that integrate cleanly with standard navigators, or to fork the standard navigators and create your own version of them with the exact look and feel you want in your app.
15
+
- Most apps heavily customize navigation, to do this with an API that wraps native navigation you will need to write a lot of native code. In React Navigation, we provide navigators written fully with JavaScript (e.g. [Stack Navigator](stack-navigator.md)) and navigators implemented on top of platform navigation primitives (e.g. [Native Stack Navigator](native-stack-navigator.md)). This lets you pick the navigators suitable for your use case, depending on whether you want native platform behavior or full customizability.
16
+
- It's possible to write your own navigators that integrate cleanly with standard navigators, or to fork the standard navigators and create your own version of them with the exact look and feel you want in your app.
17
17
18
18
## Anti-pitch
19
19
20
20
- Improvements may require breaking changes. We are working to make ["easy things easy and hard things possible"](https://www.quora.com/What-is-the-origin-of-the-phrase-make-the-easy-things-easy-and-the-hard-things-possible) and this may require us to change the API at times.
21
-
-Many navigators don't directly use the native navigation APIs on iOS and Android; rather, they use the lowest level pieces and then re-creates some subset of the APIs on top. This is a conscious choice in order to make it possible for users to customize any part of the navigation experience (because it's implemented in JavaScript) and to be able to debug issues that they encounter without needing to learn Objective C / Swift / Java / Kotlin.
22
-
- If you need the exact platform behavior, you can choose to use the navigators that use native platform primitives (e.g. [Native Stack Navigator](https://github.com/software-mansion/react-native-screens/tree/master/native-stack)), or use another library that wraps the platform APIs. Read more about these in [Alternatives](alternatives.md) and be sure to understand the tradeoffs that they make before digging in!
21
+
-Some navigators don't directly use the native navigation APIs on iOS and Android; rather, they use the lowest level pieces and then re-creates some subset of the APIs on top. This is a conscious choice in order to make it possible for users to customize any part of the navigation experience (because it's implemented in JavaScript) and to be able to debug issues that they encounter without needing to learn Objective C / Swift / Java / Kotlin.
22
+
- If you need the exact platform behavior, you can choose to use the navigators that use native platform primitives (e.g. [Native Stack Navigator](natives-stack-navigator.md)), or use another library that wraps the platform APIs. Read more about these in [Alternatives](alternatives.md) and be sure to understand the tradeoffs that they make before digging in!
23
23
- There are other limitations which you may want to consider, see [Limitations](limitations.md) for more details.
Copy file name to clipboardExpand all lines: versioned_docs/version-6.x/upgrading-from-5.x.md
+5Lines changed: 5 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -195,6 +195,10 @@ See docs for [`NavigationContainer`](navigation-container.md#ref) and [Navigatin
195
195
196
196
Earlier, `useNavigation`, `Link`, `useLinkProps` etc. could only be used inside screens. But now it's possible to use them in any component that's a child of [`NavigationContainer`](navigation-container.md).
197
197
198
+
### Stricter types for TypeScript
199
+
200
+
The type definitions are not stricter, which makes it easier to catch errors earlier by minimizing unsafe types. For example, `useNavigation` now throws an error if you don't specify a type. You can handle this by annotating it, or for an easier way, specify a type for root navigator which will be used for all usage of`useNavigation`.
201
+
198
202
### Ability to specify a type for root navigator when using TypeScript
199
203
200
204
Previously, we needed to specify a type for things such as `useNavigation`, `Link`etc. in every place we use them. But it's now possible to specify the type of the root navigator in one place that'll be used everywhere by default:
0 commit comments