Skip to content

Commit 6be220e

Browse files
committed
Make 6.x the default
1 parent cfa95fc commit 6be220e

26 files changed

+1646
-1448
lines changed

docusaurus.config.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -152,12 +152,7 @@ module.exports = {
152152
'https://github.com/react-navigation/react-navigation.github.io/edit/main/',
153153
remarkPlugins: [require('./src/plugins/remark-npm2yarn')],
154154
includeCurrentVersion: false,
155-
lastVersion: '5.x',
156-
versions: {
157-
'6.x': {
158-
label: '6.x (next)',
159-
},
160-
},
155+
lastVersion: '6.x'
161156
},
162157
theme: {
163158
customCss: require.resolve('./src/css/custom.css'),

versioned_docs/version-5.x/bottom-tab-navigator.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ A simple tab bar on the bottom of the screen that lets you switch between differ
1515
To use this navigator, ensure that you have [`@react-navigation/native` and its dependencies (follow this guide)](getting-started.md), then install [`@react-navigation/bottom-tabs`](https://github.com/react-navigation/react-navigation/tree/main/packages/bottom-tabs):
1616

1717
```bash npm2yarn
18-
npm install @react-navigation/bottom-tabs
18+
npm install @react-navigation/bottom-tabs@^5.x
1919
```
2020

2121
## API Definition

versioned_docs/version-5.x/compatibility.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ React Navigation 5 has a completely new API, so our old code using React Navigat
1111
To use the compatibility layer, we need to install [`@react-navigation/compat`](https://github.com/react-navigation/react-navigation/tree/main/packages/compat):
1212

1313
```bash npm2yarn
14-
npm install @react-navigation/native @react-navigation/compat @react-navigation/stack
14+
npm install @react-navigation/native@^5.x @react-navigation/compat@^5.x @react-navigation/stack@^5.x
1515
```
1616

1717
Then we can make minimal changes in our code to use it:

versioned_docs/version-5.x/devtools.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Developer tools to make debugging easier when using React Navigation.
99
To use the developer tools, install [`@react-navigation/devtools`](https://github.com/react-navigation/react-navigation/tree/master/packages/devtools):
1010

1111
```bash npm2yarn
12-
npm install @react-navigation/devtools
12+
npm install @react-navigation/devtools@^5.x
1313
```
1414

1515
## API Definition

versioned_docs/version-5.x/drawer-based-navigation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Common pattern in navigation is to use drawer from left (sometimes right) side f
1515
Before continuing, first install [`@react-navigation/drawer`](https://github.com/react-navigation/react-navigation/tree/main/packages/drawer):
1616

1717
```bash npm2yarn
18-
npm install @react-navigation/drawer
18+
npm install @react-navigation/drawer@^5.x
1919
```
2020

2121
## Minimal example of drawer-based navigation

versioned_docs/version-5.x/drawer-navigator.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Component that renders a navigation drawer which can be opened and closed via ge
1515
To use this navigator, ensure that you have [`@react-navigation/native` and its dependencies (follow this guide)](getting-started.md), then install [`@react-navigation/drawer`](https://github.com/react-navigation/react-navigation/tree/main/packages/drawer):
1616

1717
```bash npm2yarn
18-
npm install @react-navigation/drawer
18+
npm install @react-navigation/drawer@^5.x
1919
```
2020

2121
## API Definition

versioned_docs/version-5.x/getting-started.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Here are some resources to help you out:
2222
Install the required packages in your React Native project:
2323

2424
```bash npm2yarn
25-
npm install @react-navigation/native
25+
npm install @react-navigation/native@^5.x
2626
```
2727

2828
React Navigation is made up of some core utilities and those are then used by navigators to create the navigation structure in your app. Don't worry too much about this for now, it'll become clear soon enough! To frontload the installation work, let's also install and configure dependencies used by most navigators, then we can move forward with starting to write some code.

versioned_docs/version-5.x/hello-react-navigation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Lets start by demonstrating the most common navigator, `createStackNavigator`.
1515
The libraries we've installed so far are the building blocks and shared foundations for navigators, and each navigator in React Navigation lives in its own library. To use the stack navigator, we need to install [`@react-navigation/stack`](https://github.com/react-navigation/react-navigation/tree/main/packages/stack) :
1616

1717
```bash npm2yarn
18-
npm install @react-navigation/stack
18+
npm install @react-navigation/stack@^5.x
1919
```
2020

2121
> 💡 `@react-navigation/stack` depends on `@react-native-community/masked-view` and the other libraries that we installed in [Getting started](getting-started.md). If you haven't installed those yet, head over to that page and follow the installation instructions.

versioned_docs/version-5.x/material-bottom-tab-navigator.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ This wraps the [`BottomNavigation`](https://callstack.github.io/react-native-pap
1313
To use this navigator, ensure that you have [`@react-navigation/native` and its dependencies (follow this guide)](getting-started.md), then install [`@react-navigation/material-bottom-tabs`](https://github.com/react-navigation/react-navigation/tree/main/packages/material-bottom-tabs):
1414

1515
```bash npm2yarn
16-
npm install @react-navigation/material-bottom-tabs react-native-paper react-native-vector-icons
16+
npm install @react-navigation/material-bottom-tabs@^5.x react-native-paper react-native-vector-icons
1717
```
1818

1919
This API also requires that you install `react-native-vector-icons`! If you are using Expo managed workflow, it will work without any extra steps. Otherwise, [follow these installation instructions](https://github.com/oblador/react-native-vector-icons#installation).

versioned_docs/version-5.x/material-top-tab-navigator.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ This wraps [`react-native-tab-view`](https://github.com/react-native-community/r
1717
To use this navigator, ensure that you have [`@react-navigation/native` and its dependencies (follow this guide)](getting-started.md), then install [`@react-navigation/material-top-tabs`](https://github.com/react-navigation/react-navigation/tree/main/packages/material-top-tabs):
1818

1919
```bash npm2yarn
20-
npm install @react-navigation/material-top-tabs react-native-tab-view@^2.16.0
20+
npm install @react-navigation/material-top-tabs@^5.x react-native-tab-view@^2.x
2121
```
2222

2323
## API Definition

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ By default the stack navigator is configured to have the familiar iOS and Androi
1717
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):
1818

1919
```bash npm2yarn
20-
npm install @react-navigation/stack
20+
npm install @react-navigation/stack@^5.x
2121
```
2222

2323
## API Definition

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ This guide covers [`createBottomTabNavigator`](bottom-tab-navigator.md). You may
1111
Before continuing, first install [`@react-navigation/bottom-tabs`](https://github.com/react-navigation/react-navigation/tree/main/packages/bottom-tabs):
1212

1313
```bash npm2yarn
14-
npm install @react-navigation/bottom-tabs
14+
npm install @react-navigation/bottom-tabs@^5.x
1515
```
1616

1717
## Minimal example of tab-based navigation

versioned_docs/version-6.x/bottom-tab-navigator.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ A simple tab bar on the bottom of the screen that lets you switch between differ
1515
To use this navigator, ensure that you have [`@react-navigation/native` and its dependencies (follow this guide)](getting-started.md), then install [`@react-navigation/bottom-tabs`](https://github.com/react-navigation/react-navigation/tree/main/packages/bottom-tabs):
1616

1717
```bash npm2yarn
18-
npm install @react-navigation/bottom-tabs@next
18+
npm install @react-navigation/bottom-tabs
1919
```
2020

2121
## API Definition

versioned_docs/version-6.x/devtools.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Developer tools to make debugging easier when using React Navigation.
99
To use the developer tools, install [`@react-navigation/devtools`](https://github.com/react-navigation/react-navigation/tree/master/packages/devtools):
1010

1111
```bash npm2yarn
12-
npm install @react-navigation/devtools@next
12+
npm install @react-navigation/devtools
1313
```
1414

1515
Hooks from this package only work during development and are disabled in production. You don't need to do anything special to remove them from the production build.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Common pattern in navigation is to use drawer from left (sometimes right) side f
1515
Before continuing, first install [`@react-navigation/drawer`](https://github.com/react-navigation/react-navigation/tree/main/packages/drawer):
1616

1717
```bash npm2yarn
18-
npm install @react-navigation/drawer@next
18+
npm install @react-navigation/drawer
1919
```
2020

2121
## Minimal example of drawer-based navigation

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Component that renders a navigation drawer which can be opened and closed via ge
1515
To use this navigator, ensure that you have [`@react-navigation/native` and its dependencies (follow this guide)](getting-started.md), then install [`@react-navigation/drawer`](https://github.com/react-navigation/react-navigation/tree/main/packages/drawer):
1616

1717
```bash npm2yarn
18-
npm install @react-navigation/drawer@next
18+
npm install @react-navigation/drawer
1919
```
2020

2121
## API Definition

versioned_docs/version-6.x/elements.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ A component library containing the UI elements and helpers used in React Navigat
99
To use this package, ensure that you have [`@react-navigation/native` and its dependencies (follow this guide)](getting-started.md), then install [`@react-navigation/bottom-tabs`](https://github.com/react-navigation/react-navigation/tree/main/packages/elements):
1010

1111
```sh npm2yarn
12-
npm install @react-navigation/elements@next
12+
npm install @react-navigation/elements
1313
```
1414

1515
## Components

versioned_docs/version-6.x/getting-started.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ React Navigation 6 requires at least `react-native@0.63.0`. If you're using Expo
2626
Install the required packages in your React Native project:
2727

2828
```bash npm2yarn
29-
npm install @react-navigation/native@next
29+
npm install @react-navigation/native
3030
```
3131

3232
React Navigation is made up of some core utilities and those are then used by navigators to create the navigation structure in your app. Don't worry too much about this for now, it'll become clear soon enough! To frontload the installation work, let's also install and configure dependencies used by most navigators, then we can move forward with starting to write some code.

versioned_docs/version-6.x/hello-react-navigation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Let's start by demonstrating the most common navigator, `createNativeStackNaviga
1515
The libraries we've installed so far are the building blocks and shared foundations for navigators, and each navigator in React Navigation lives in its own library. To use the native stack navigator, we need to install [`@react-navigation/native-stack`](https://github.com/react-navigation/react-navigation/tree/main/packages/native-stack) :
1616

1717
```bash npm2yarn
18-
npm install @react-navigation/native-stack@next
18+
npm install @react-navigation/native-stack
1919
```
2020

2121
> 💡 `@react-navigation/native-stack` depends on `react-native-screens` and the other libraries that we installed in [Getting started](getting-started.md). If you haven't installed those yet, head over to that page and follow the installation instructions.

versioned_docs/version-6.x/material-bottom-tab-navigator.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ This wraps the [`BottomNavigation`](https://callstack.github.io/react-native-pap
1313
To use this navigator, ensure that you have [`@react-navigation/native` and its dependencies (follow this guide)](getting-started.md), then install [`@react-navigation/material-bottom-tabs`](https://github.com/react-navigation/react-navigation/tree/main/packages/material-bottom-tabs):
1414

1515
```bash npm2yarn
16-
npm install @react-navigation/material-bottom-tabs@next react-native-paper react-native-vector-icons
16+
npm install @react-navigation/material-bottom-tabs react-native-paper react-native-vector-icons
1717
```
1818

1919
This API also requires that you install `react-native-vector-icons`! If you are using Expo managed workflow, it will work without any extra steps. Otherwise, [follow these installation instructions](https://github.com/oblador/react-native-vector-icons#installation).

versioned_docs/version-6.x/material-top-tab-navigator.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ This wraps [`react-native-tab-view`](https://github.com/react-native-community/r
1717
To use this navigator, ensure that you have [`@react-navigation/native` and its dependencies (follow this guide)](getting-started.md), then install [`@react-navigation/material-top-tabs`](https://github.com/react-navigation/react-navigation/tree/main/packages/material-top-tabs):
1818

1919
```bash npm2yarn
20-
npm install @react-navigation/material-top-tabs@next react-native-tab-view react-native-pager-view
20+
npm install @react-navigation/material-top-tabs react-native-tab-view react-native-pager-view
2121
```
2222

2323
## API Definition

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ This navigator does not currently support web. Use `createStackNavigator` for th
1515
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):
1616

1717
```bash npm2yarn
18-
npm install @react-navigation/native-stack@next
18+
npm install @react-navigation/native-stack
1919
```
2020

2121
## API Definition

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ By default the stack navigator is configured to have the familiar iOS and Androi
1717
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):
1818

1919
```bash npm2yarn
20-
npm install @react-navigation/stack@next
20+
npm install @react-navigation/stack
2121
```
2222

2323
## API Definition

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ This guide covers [`createBottomTabNavigator`](bottom-tab-navigator.md). You may
1111
Before continuing, first install [`@react-navigation/bottom-tabs`](https://github.com/react-navigation/react-navigation/tree/main/packages/bottom-tabs):
1212

1313
```bash npm2yarn
14-
npm install @react-navigation/bottom-tabs@next
14+
npm install @react-navigation/bottom-tabs
1515
```
1616

1717
## Minimal example of tab-based navigation

versioned_docs/version-6.x/upgrading-from-5.x.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ These following changes are in the core library. You'll need to address this cha
1515
To install the 6.x version of `@react-navigation/native`, run:
1616

1717
```sh npm2yarn
18-
npm install @react-navigation/native@next
18+
npm install @react-navigation/native
1919
```
2020

2121
### Older versions of some libraries are no longer supported
@@ -162,7 +162,7 @@ The following changes are in the `@react-navigation/stack` package.
162162
To install the 6.x version of `@react-navigation/stack`, run:
163163

164164
```sh npm2yarn
165-
npm install @react-navigation/stack@next
165+
npm install @react-navigation/stack
166166
```
167167

168168
### `keyboardHandlingEnabled` is moved to options
@@ -256,7 +256,7 @@ The `@react-navigation/native-stack` package is back. We made few changes to the
256256
To install the 6.x version of `@react-navigation/native-stack`, run:
257257

258258
```sh npm2yarn
259-
npm install @react-navigation/native-stack@next react-native-screens react-native-safe-area-context
259+
npm install @react-navigation/native-stack react-native-screens react-native-safe-area-context
260260
```
261261

262262
**TODO**
@@ -268,7 +268,7 @@ The following changes are in the `@react-navigation/bottom-tabs` package.
268268
To install the 6.x version of `@react-navigation/bottom-tabs`, run:
269269

270270
```sh npm2yarn
271-
npm install @react-navigation/bottom-tabs@next
271+
npm install @react-navigation/bottom-tabs
272272
```
273273

274274
### A header is shown by default in tab screens
@@ -327,7 +327,7 @@ The following changes are in the `@react-navigation/material-top-tabs` package.
327327
To install the 6.x version of `@react-navigation/material-top-tabs`, run:
328328

329329
```sh npm2yarn
330-
npm install @react-navigation/material-top-tabs@next react-native-pager-view
330+
npm install @react-navigation/material-top-tabs react-native-pager-view
331331
```
332332

333333
### It now uses `ViewPager` instead of Reanimated and Gesture Handler
@@ -380,7 +380,7 @@ The following changes are in the `@react-navigation/material-bottom-tabs` packag
380380
To install the 6.x version of `@react-navigation/material-bottom-tabs`, run:
381381

382382
```sh npm2yarn
383-
npm install @react-navigation/material-bottom-tabs@next react-native-safe-area-context
383+
npm install @react-navigation/material-bottom-tabs react-native-safe-area-context
384384
```
385385

386386
It's also necessary to install the `react-native-safe-area-context` package when using `@react-navigation/material-bottom-tab`, if you didn't have it already:
@@ -396,7 +396,7 @@ The following changes are in the `@react-navigation/drawer` package.
396396
To install the 6.x version of `@react-navigation/drawer`, run:
397397

398398
```sh npm2yarn
399-
npm install @react-navigation/drawer@next
399+
npm install @react-navigation/drawer
400400
```
401401

402402
### Drawer now uses Reanimated 2 if available
@@ -466,7 +466,7 @@ Similar to bottom tabs, drawer now uses `firstRoute` for the `backBehavior` prop
466466
We have a new package which contains various UI elements related to navigation, such as a `Header` component. This means that we can now use these components in all navigators. You can also install the library to import components such as `Header` to use in any navigator:
467467

468468
```sh npm2yarn
469-
npm install @react-navigation/elements@next react-native-safe-area-context
469+
npm install @react-navigation/elements react-native-safe-area-context
470470
```
471471

472472
Now you can import items from there:

0 commit comments

Comments
 (0)