Skip to content

Commit 35144ea

Browse files
docs: use native-stack in tab-based-navigation
1 parent 9403d1d commit 35144ea

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

static/examples/6.x/tab-based-navigation-stack.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as React from 'react';
22
import { Button, Text, View } from 'react-native';
33
import { NavigationContainer } from '@react-navigation/native';
4-
import { createStackNavigator } from '@react-navigation/stack';
4+
import { createNativeStackNavigator } from '@react-navigation/native-stack';
55
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
66

77
function DetailsScreen() {
@@ -36,7 +36,7 @@ function SettingsScreen({ navigation }) {
3636
);
3737
}
3838

39-
const HomeStack = createStackNavigator();
39+
const HomeStack = createNativeStackNavigator();
4040

4141
function HomeStackScreen() {
4242
return (
@@ -47,7 +47,7 @@ function HomeStackScreen() {
4747
);
4848
}
4949

50-
const SettingsStack = createStackNavigator();
50+
const SettingsStack = createNativeStackNavigator();
5151

5252
function SettingsStackScreen() {
5353
return (

versioned_docs/version-6.x/tab-based-navigation.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export default function App() {
5656

5757
## Customizing the appearance
5858

59-
This is similar to how you would customize a stack navigator — there are some properties that are set when you initialize the tab navigator and others that can be customized per-screen in `options`.
59+
This is similar to how you would customize a native stack navigator — there are some properties that are set when you initialize the tab navigator and others that can be customized per-screen in `options`.
6060

6161
<samp id="tab-based-navigation-icons" />
6262

@@ -149,7 +149,7 @@ function SettingsScreen({ navigation }) {
149149
}
150150
```
151151

152-
## A stack navigator for each tab
152+
## A native stack navigator for each tab
153153

154154
Usually tabs don't just display one screen &mdash; for example, on your Twitter feed, you can tap on a tweet and it brings you to a new screen within that tab with all of the replies. You can think of this as there being separate navigation stacks within each tab, and that's exactly how we will model it in React Navigation.
155155

@@ -159,7 +159,7 @@ Usually tabs don't just display one screen &mdash; for example, on your Twitter
159159
import * as React from 'react';
160160
import { Button, Text, View } from 'react-native';
161161
import { NavigationContainer } from '@react-navigation/native';
162-
import { createStackNavigator } from '@react-navigation/stack';
162+
import { createNativeStackNavigator } from '@react-navigation/native-stack';
163163
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
164164

165165
function DetailsScreen() {
@@ -194,7 +194,7 @@ function SettingsScreen({ navigation }) {
194194
);
195195
}
196196

197-
const HomeStack = createStackNavigator();
197+
const HomeStack = createNativeStackNavigator();
198198

199199
function HomeStackScreen() {
200200
return (
@@ -205,7 +205,7 @@ function HomeStackScreen() {
205205
);
206206
}
207207

208-
const SettingsStack = createStackNavigator();
208+
const SettingsStack = createNativeStackNavigator();
209209

210210
function SettingsStackScreen() {
211211
return (

0 commit comments

Comments
 (0)