Skip to content

Commit a5c3752

Browse files
committed
Tweak docs for stack & native stack
1 parent 2be39cd commit a5c3752

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

versioned_docs/version-6.x/native-stack-navigator.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,9 @@ sidebar_label: Native Stack
66

77
Native Stack Navigator provides a way for your app to transition between screens where each new screen is placed on top of a stack.
88

9-
This navigator uses the native APIs `UINavigationController` on iOS and `Fragment` on Android so that navigation built with `createNativeStackNavigator` will behave exactly the same and have the same performance characteristics as apps built natively on top of those APIs.
9+
This navigator uses the native APIs `UINavigationController` on iOS and `Fragment` on Android so that navigation built with `createNativeStackNavigator` will behave exactly the same and have the same performance characteristics as apps built natively on top of those APIs. It also offers basic Web support using [`react-native-web`](https://github.com/necolas/react-native-web).
1010

11-
The tradeoff is that `createNativeStackNavigator` isn't quite as customizable, so sometimes you may want to use `createStackNavigator` instead in order to achieve the exact appearance or behaviour that you desire for your app.
12-
13-
This navigator does not currently support web. Use `createStackNavigator` for the web navigation in your app instead.
11+
One thing to keep in mind is that while `createNativeStackNavigator` offers native performance and exposes native features such as large title on iOS etc., it isn't as customizable as [`createStackNavigator`](stack-navigator.md), So if you need more customization than what's possible in this navigator, consider using `createStackNavigator` instead - which is a more customizable JavaScript based implementation.
1412

1513
To use this navigator, ensure that you have [`@react-navigation/native` and its dependencies (follow this guide)](getting-started.md), then install [`@react-navigation/native-stack`](https://github.com/react-navigation/react-navigation/tree/main/packages/native-stack):
1614

versioned_docs/version-6.x/stack-navigator.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,16 @@ sidebar_label: Stack
66

77
Stack Navigator provides a way for your app to transition between screens where each new screen is placed on top of a stack.
88

9-
By default the stack navigator is configured to have the familiar iOS and Android look & feel: new screens slide in from the right on iOS, fade in from the bottom on Android. On iOS the stack navigator can also be configured to a modal style where screens slide in from the bottom.
9+
By default the stack navigator is configured to have the familiar iOS and Android look & feel: new screens slide in from the right on iOS, use OS default animation on Android. But the [animations can be customize](#animation-related-options) to match your needs.
1010

1111
<div style={{ display: 'flex', margin: '16px 0' }}>
1212
<video playsInline autoPlay muted loop>
1313
<source src="/assets/navigators/stack/stack.mov" />
1414
</video>
1515
</div>
1616

17+
One thing to keep in mind is that while `createStackNavigator` is extremely customizable, it's implemented in JavaScript. While it runs animations and gestures using natively, the performance may not be as fast as a native implementation. This may not be an issue for a lot of apps, but if you're experiencing performance issues during navigation, consider using [`createNativeStackNavigator`](native-stack-navigator.md) instead - which uses native navigation primitives.
18+
1719
To use this navigator, ensure that you have [`@react-navigation/native` and its dependencies (follow this guide)](getting-started.md), then install [`@react-navigation/stack`](https://github.com/react-navigation/react-navigation/tree/main/packages/stack):
1820

1921
```bash npm2yarn
@@ -244,8 +246,6 @@ By default, there is one floating header which renders headers for multiple scre
244246

245247
If you specify a custom header, React Navigation will change it to `screen` automatically so that the header animated along with the screen instead. This means that you don't have to implement animations to animate it separately.
246248

247-
Setting the `headerMode` prop to `screen` makes the header part of the screen, so you don't have to implement animations to animate it separately.
248-
249249
But you might want to keep the floating header to have a different transition animation between headers. To do that, you'll need to specify `headerMode: 'float'` in the options, and then interpolate on the `progress.current` and `progress.next` props in your custom header. For example, following will cross-fade the header:
250250

251251
```js
@@ -263,8 +263,8 @@ return (
263263

264264
Specifies how the header should be rendered:
265265

266-
- `float` - Render a single header that stays at the top and animates as screens are changed. This is a common pattern on iOS.
267-
- `screen` - Each screen has a header attached to it and the header fades in and out together with the screen. This is a common pattern on Android.
266+
- `float` - Render a single header that stays at the top and animates as screens are changed. This is default on iOS.
267+
- `screen` - Each screen has a header attached to it and the header fades in and out together with the screen. This is default on other platforms.
268268

269269
#### `headerShown`
270270

0 commit comments

Comments
 (0)