Skip to content

Commit a5049ba

Browse files
authored
Update native stack docs to clarify potential memory issue
1 parent 667fa29 commit a5049ba

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@ Native Stack Navigator provides a way for your app to transition between screens
1616

1717
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).
1818

19-
One thing to keep in mind is that while `@react-navigation/native-stack` offers native performance and exposes native features such as large title on iOS etc., it may not be as customizable as [`@react-navigation/stack`](stack-navigator.md) depending on your needs. So if you need more customization than what's possible in this navigator, consider using `@react-navigation/stack` instead - which is a more customizable JavaScript based implementation.
19+
A few things to keep in mind:
20+
* While `@react-navigation/native-stack` offers native performance and exposes native features such as large title on iOS etc., it may not be as customizable as [`@react-navigation/stack`](stack-navigator.md) depending on your needs.
21+
* While `@react-navigation/stack` renders only views that are visible, `@react-navigation/native-stack` will require all views to be kept in memory regardless of visibility. In particular, this is important if your stack model allows the user to place a new screen on top of the stack infinitely. This may lead to out-of-memory issues.
22+
23+
So if you need more customization than what's possible in this navigator, or if memory becomes a concern, consider using `@react-navigation/stack` instead - which is a more customizable JavaScript based implementation.
2024

2125
## Installation
2226

0 commit comments

Comments
 (0)