You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: versioned_docs/version-7.x/deep-linking.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ This guide will describe how to configure your app to handle deep links on vario
14
14
15
15
React Native provides a [`Linking`](https://reactnative.dev/docs/linking) to get notified of incoming links. React Navigation can integrate with the `Linking` module to automatically handle deep links. On Web, React Navigation can integrate with browser's `history` API to handle URLs on client side. See [configuring links](configuring-links.md) to see more details on how to configure links in React Navigation.
16
16
17
-
While you don't need to use the `linking` prop from React Navigation, and can handle deep links yourself by using the `Linking` API and navigating from there, it'll be significantly more complicated than using the `linking` prop which handles many edge cases for you. So we don't recommend implementing it by yourself.
17
+
We don't recommend handling deep links yourself using a [`ref`](navigation-container.md#ref) as it can be error-prone and significantly more complicated. Using the `linking` prop is the recommended way to handle deep links in React Navigation.
18
18
19
19
Below, we'll go through required configurations so that the deep link integration works.
Copy file name to clipboardExpand all lines: versioned_docs/version-7.x/drawer-actions.md
+45-36Lines changed: 45 additions & 36 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,6 +9,8 @@ import TabItem from '@theme/TabItem';
9
9
10
10
`DrawerActions` is an object containing methods for generating actions specific to drawer-based navigators. Its methods expand upon the actions available in [CommonActions](navigation-actions.md).
11
11
12
+
For screens inside a [Drawer Navigator](drawer-navigator.md), drawer actions are available as methods on the `navigation` object.
13
+
12
14
The following actions are supported:
13
15
14
16
## openDrawer
@@ -34,7 +36,7 @@ function HomeScreen() {
34
36
<Button
35
37
onPress={() => {
36
38
// codeblock-focus-start
37
-
navigation.dispatch(DrawerActions.openDrawer());
39
+
navigation.openDrawer();
38
40
// codeblock-focus-end
39
41
}}
40
42
>
@@ -57,6 +59,14 @@ export default function App() {
Copy file name to clipboardExpand all lines: versioned_docs/version-7.x/getting-started.md
+13-21Lines changed: 13 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,26 +7,7 @@ sidebar_label: Getting started
7
7
import Tabs from '@theme/Tabs';
8
8
import TabItem from '@theme/TabItem';
9
9
10
-
The _Fundamentals_ section covers the most important aspects of React Navigation. It should be enough to build a typical mobile application and give you the background to dive deeper into the more advanced topics.
11
-
12
-
<details>
13
-
<summary>Prior knowledge</summary>
14
-
15
-
If you're already familiar with JavaScript, React and React Native, you'll be able to get moving with React Navigation quickly! If not, we recommend gaining some basic knowledge first, then coming back here when you're done.
-`expo` >= 52 (if you use [Expo Go](https://expo.dev/go))
27
-
-`typescript` >= 5.0.0 (if you use TypeScript)
28
-
29
-
</details>
10
+
React Navigation is a navigation library for React Native and Web. It provides routing logic and UI common on mobile apps and PWAs with type-safe navigation, built-in universal links on mobile, and browser history integration on the web.
30
11
31
12
## Starter template
32
13
@@ -48,6 +29,15 @@ In your project directory, run:
48
29
npm install @react-navigation/native
49
30
```
50
31
32
+
<details>
33
+
<summary>Minimum requirements</summary>
34
+
35
+
-`react-native` >= 0.72.0
36
+
-`expo` >= 52 (if you use [Expo Go](https://expo.dev/go))
37
+
-`typescript` >= 5.0.0 (if you use TypeScript)
38
+
39
+
</details>
40
+
51
41
### Installing dependencies
52
42
53
43
Next, install the dependencies used by most navigators: [`react-native-screens`](https://github.com/software-mansion/react-native-screens) and [`react-native-safe-area-context`](https://github.com/th3rdwave/react-native-safe-area-context).
@@ -160,6 +150,8 @@ In `AndroidManifest.xml`, set `android:enableOnBackInvokedCallback` to `false` i
160
150
161
151
## Setting up React Navigation
162
152
153
+
The guides linked below cover the fundamentals of React Navigation, and give you the background to dive deeper into the more advanced topics.
154
+
163
155
When using React Navigation, you configure [**navigators**](glossary-of-terms.md#navigator) in your app. Navigators handle transitions between screens and provide UI such as headers, tab bars, etc.
164
156
165
157
There are 2 ways to configure navigators:
@@ -172,6 +164,6 @@ There are 2 ways to configure navigators:
Component-based configuration with significantly more boilerplate. Supports dynamic screen lists and navigator options.
167
+
Component-based configuration with significantly more boilerplate for TypeScript and deep linking. Supports dynamic screen lists and navigator options.
See [`replace`](stack-actions.md#replace) for more details.
1317
+
1316
1318
#### `push`
1317
1319
1318
1320
Pushes a new screen to the top of the stack and navigate to it. The method accepts the following arguments:
@@ -1324,6 +1326,8 @@ Pushes a new screen to the top of the stack and navigate to it. The method accep
1324
1326
navigation.push('Profile', { owner:'Michaś' });
1325
1327
```
1326
1328
1329
+
See [`push`](stack-actions.md#push) for more details.
1330
+
1327
1331
#### `pop`
1328
1332
1329
1333
Pops the current screen from the stack and navigates back to the previous screen. It takes one optional argument (`count`), which allows you to specify how many screens to pop back by.
@@ -1332,6 +1336,8 @@ Pops the current screen from the stack and navigates back to the previous screen
1332
1336
navigation.pop();
1333
1337
```
1334
1338
1339
+
See [`pop`](stack-actions.md#pop) for more details.
1340
+
1335
1341
#### `popTo`
1336
1342
1337
1343
Navigates back to a previous screen in the stack by popping screens after it. The method accepts the following arguments:
@@ -1347,6 +1353,8 @@ If a matching screen is not found in the stack, this will pop the current screen
1347
1353
navigation.popTo('Profile', { owner:'Michaś' });
1348
1354
```
1349
1355
1356
+
See [`popTo`](stack-actions.md#popto) for more details.
1357
+
1350
1358
#### `popToTop`
1351
1359
1352
1360
Pops all of the screens in the stack except the first one and navigates to it.
@@ -1355,6 +1363,8 @@ Pops all of the screens in the stack except the first one and navigates to it.
1355
1363
navigation.popToTop();
1356
1364
```
1357
1365
1366
+
See [`popToTop`](stack-actions.md#poptotop) for more details.
1367
+
1358
1368
### Hooks
1359
1369
1360
1370
The native stack navigator exports the following hooks:
0 commit comments