Skip to content

Commit 73895cd

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

30 files changed

+1424
-1493
lines changed

blog/2020-02-06-react-navigation-5.0.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ Hooks are great for stateful logic and code organization. Now we have several ho
5252
- [`useNavigationState`](/docs/use-navigation-state)
5353
- [`useFocusEffect`](/docs/use-focus-effect)
5454
- [`useIsFocused`](/docs/use-is-focused)
55-
- [`useLinking`](/docs/use-linking)
5655
- [`useScrollToTop`](/docs/use-scroll-to-top)
5756

5857
### Update options from component
@@ -158,7 +157,7 @@ This is a big release and, while the basic concepts such as nesting are the same
158157

159158
We recommend starting your new projects with the new version so you can take advantage of the new APIs and the new features.
160159

161-
We have written an [upgrade guide](/docs/upgrading-from-4.x) which will give you an overview of what's changed and how to adapt the old API and concepts to the new API.
160+
We have written an [upgrade guide](/docs/5.x/upgrading-from-4.x) which will give you an overview of what's changed and how to adapt the old API and concepts to the new API.
162161

163162
## A note for alpha users
164163

blog/2021-03-12-react-navigation-6.0-next.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,17 @@ We're excited to announce that we finally have a prerelease version of React Na
1313

1414
While React Navigation 5 was complete overhaul to the API of React Navigation, React Navigation 6 keeps the same API, with some breaking changes to make things more consistent and provide more flexibility. We also tried to address some common pain points and confusions that users had.
1515

16-
We'll share few highlights of the release in this blog post. If you're looking for a detailed upgrade guide, you can find it [here](/docs/6.x/upgrading-from-5.x).
16+
We'll share few highlights of the release in this blog post. If you're looking for a detailed upgrade guide, you can find it [here](/docs/upgrading-from-5.x).
1717

1818
## Highlights
1919

2020
- Params are now overwritten on navigation instead of merging (with option to merge them)
21-
- Modals in [stack](/docs/6.x/stack-navigator) now use the presentation style on iOS by default, and there's a new slide animation for modals on Android
22-
- [Drawer](/docs/6.x/drawer-navigator) now uses a slide animation by default on iOS
23-
- Headers are now shown by default in [drawer](/docs/6.x/drawer-navigator) and [bottom tab](/docs/6.x/bottom-tab-navigator) screens, so you don't need extra stack navigators
24-
- We got rid of `tabBarOptions`, `drawerContentOptions` etc. and moved those to [`options` prop on screen](/docs/6.x/screen-options) to make it possible to configure them per screen
25-
- [Material Top Tabs](/docs/6.x/material-top-tab-navigator) now use a `ViewPager` based implementation, which means it'll provide a native experience
26-
- We now have a [UI elements library](/docs/6.x/elements) which contains various components we use in React Navigation
21+
- Modals in [stack](/docs/stack-navigator) now use the presentation style on iOS by default, and there's a new slide animation for modals on Android
22+
- [Drawer](/docs/drawer-navigator) now uses a slide animation by default on iOS
23+
- Headers are now shown by default in [drawer](/docs/drawer-navigator) and [bottom tab](/docs/bottom-tab-navigator) screens, so you don't need extra stack navigators
24+
- We got rid of `tabBarOptions`, `drawerContentOptions` etc. and moved those to [`options` prop on screen](/docs/screen-options) to make it possible to configure them per screen
25+
- [Material Top Tabs](/docs/material-top-tab-navigator) now use a `ViewPager` based implementation, which means it'll provide a native experience
26+
- We now have a [UI elements library](/docs/elements) which contains various components we use in React Navigation
2727

2828
## Try it out
2929

@@ -35,7 +35,7 @@ npm install @react-navigation/native@next @react-navigation/stack@next
3535

3636
## What's next?
3737

38-
We're planning to update our documentation to recommend [native-stack](/docs/6.x/native-stack-navigator) as the default. This will provide the best performance for people who don't need a lot of customization, while still having the option to use the JavaScript based implementation if they need it.
38+
We're planning to update our documentation to recommend [native-stack](/docs/native-stack-navigator) as the default. This will provide the best performance for people who don't need a lot of customization, while still having the option to use the JavaScript based implementation if they need it.
3939

4040
## Sponsor us
4141

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'),

src/pages/home/Splash/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export default function Splash() {
4343
<div className={styles.migrationText}>
4444
💡 Coming from v4? Check out our{' '}
4545
<Link
46-
to={useBaseUrl('/docs/upgrading-from-4.x')}
46+
to={useBaseUrl('/docs/5.x/upgrading-from-4.x')}
4747
className={styles.linkText}
4848
>
4949
v4 to v5 migration guide

src/pages/versions.js

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,8 @@ import versions from '../../versions.json';
1111
function Version() {
1212
const context = useDocusaurusContext();
1313
const {siteConfig = {}} = context;
14-
const nextVersion = versions[0];
15-
const latestVersion = versions[1];
16-
const pastVersions = versions.slice(2, versions.length);
14+
const latestVersion = versions[0];
15+
const pastVersions = versions.slice(1, versions.length);
1716
const repoUrl = `https://github.com/${siteConfig.organizationName}/${siteConfig.projectName}`;
1817

1918
return (
@@ -38,22 +37,6 @@ function Version() {
3837
</tbody>
3938
</table>
4039
</div>
41-
<div className="margin-bottom--lg">
42-
<h3 id="latest">Next version (Unreleased)</h3>
43-
<p>Here you can find the documentation for work-in-process unreleased version.</p>
44-
<table>
45-
<tbody>
46-
<tr>
47-
<th>{nextVersion}</th>
48-
<td>
49-
<Link to={useBaseUrl(`/docs/${nextVersion}/getting-started`)}>
50-
Documentation
51-
</Link>
52-
</td>
53-
</tr>
54-
</tbody>
55-
</table>
56-
</div>
5740
{pastVersions.length > 0 && (
5841
<div className="margin-bottom--lg">
5942
<h3 id="archive">Past Versions</h3>

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

0 commit comments

Comments
 (0)