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/bottom-tab-navigator.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -53,7 +53,7 @@ The `Tab.Navigator` component accepts following props:
53
53
54
54
#### `id`
55
55
56
-
Optional unique ID for the navigator. This can be used with [`navigation.getParent`](navigation-prop.md#getparent) to refer to this navigator in a child navigator.
56
+
Optional unique ID for the navigator. This can be used with [`navigation.getParent`](navigation-object.md#getparent) to refer to this navigator in a child navigator.
57
57
58
58
#### `initialRouteName`
59
59
@@ -442,7 +442,7 @@ React.useEffect(() => {
442
442
443
443
### Helpers
444
444
445
-
The tab navigator adds the following methods to the navigation prop:
445
+
The tab navigator adds the following methods to the navigation object:
Copy file name to clipboardExpand all lines: versioned_docs/version-7.x/custom-navigators.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
@@ -40,7 +40,7 @@ The hook returns an object with following properties:
40
40
-`navigation` - The navigation object containing various helper methods for the navigator to manipulate the [navigation state](navigation-state.md). This isn't the same as the navigation object for the screen and includes some helpers such as `emit` to emit events to the screens.
41
41
-`descriptors` - This is an object containing descriptors for each route with the route keys as its properties. The descriptor for a route can be accessed by `descriptors[route.key]`. Each descriptor contains the following properties:
42
42
43
-
-`navigation` - The navigation prop for the screen. You don't need to pass this to the screen manually. But it's useful if we're rendering components outside the screen that need to receive `navigation` prop as well, such as a header component.
43
+
-`navigation` - The navigation object for the screen. You don't need to pass this to the screen manually. But it's useful if we're rendering components outside the screen that need to receive `navigation` prop as well, such as a header component.
44
44
-`options` - A getter which returns the options such as `title` for the screen if they are specified.
45
45
-`render` - A function which can be used to render the actual screen. Calling `descriptors[route.key].render()` will return a React element containing the screen content. It's important to use this method to render a screen, otherwise any child navigators won't be connected to the navigation tree properly.
Instead of writing a custom router to handle custom actions, you can [pass a function to `dispatch`](navigation-prop.md#dispatch) instead. It's cleaner and recommended instead of overriding routers.
185
+
Instead of writing a custom router to handle custom actions, you can [pass a function to `dispatch`](navigation-object.md#dispatch) instead. It's cleaner and recommended instead of overriding routers.
Copy file name to clipboardExpand all lines: versioned_docs/version-7.x/drawer-navigator.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -91,7 +91,7 @@ The `Drawer.Navigator` component accepts following props:
91
91
92
92
#### `id`
93
93
94
-
Optional unique ID for the navigator. This can be used with [`navigation.getParent`](navigation-prop.md#getparent) to refer to this navigator in a child navigator.
94
+
Optional unique ID for the navigator. This can be used with [`navigation.getParent`](navigation-object.md#getparent) to refer to this navigator in a child navigator.
95
95
96
96
#### `initialRouteName`
97
97
@@ -529,7 +529,7 @@ If you have custom drawer content, make sure to emit this event.
529
529
530
530
### Helpers
531
531
532
-
The drawer navigator adds the following methods to the navigation prop:
532
+
The drawer navigator adds the following methods to the navigation object:
Copy file name to clipboardExpand all lines: versioned_docs/version-7.x/getting-started.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -129,7 +129,7 @@ There are 2 primary ways to configure the navigators:
129
129
130
130
The static configuration API has reduced boilerplate and simplifies things such as TypeScript types and deep linking. If you're starting a new project or are new to React Navigation, this is the **recommended way** to set up your app.
131
131
132
-
Continue to ["Hello React Navigation"](hello-react-navigation.md?config=static) to start writing some code with the Static API.
132
+
Continue to ["Hello React Navigation"](hello-react-navigation.md?config=static) to start writing some code with the static API.
133
133
134
134
### Dynamic configuration
135
135
@@ -154,4 +154,4 @@ In a typical React Native app, the `NavigationContainer` should be only used onc
154
154
155
155
:::
156
156
157
-
Continue to ["Hello React Navigation"](hello-react-navigation.md?config=dynamic) to start writing some code with the Dynamic API.
157
+
Continue to ["Hello React Navigation"](hello-react-navigation.md?config=dynamic) to start writing some code with the dynamic API.
Copy file name to clipboardExpand all lines: versioned_docs/version-7.x/glossary-of-terms.md
+17-38Lines changed: 17 additions & 38 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -55,41 +55,32 @@ const StackNavigator = (
55
55
56
56
The suffix `Screen` in the component name is entirely optional, but a frequently used convention; we could call it `Michael` and this would work just the same.
57
57
58
-
We saw earlier that our screen components are provided with the `navigation` prop. It's important to note that _this only happens if the screen is rendered as a route by React Navigation_ (for example, in response to `navigation.navigate`). For example, if we render `DetailsScreen` as a child of `HomeScreen`, then `DetailsScreen` won't be provided with the `navigation` prop, and when you press the "Go to Details... again" button on the Home screen, the app will throw one of the quintessential JavaScript exceptions "undefined is not an object".
The ["Navigation prop reference"](navigation-prop.md) section goes into more detail on this, describes workarounds, and provides more information on other properties available on `navigation` prop.
76
-
77
-
## Navigation Prop
78
-
79
-
This prop will be passed to all screens, and it can be used for the following:
60
+
The navigation object contains methods used for navigation. It contains methods such as:
80
61
81
62
-`dispatch` will send an action up to the router
82
63
-`navigate`, `goBack`, etc are available to dispatch actions in a convenient way
83
64
84
-
Navigators can also accept a navigation prop, which they should get from the parent navigator, if there is one.
65
+
This object can be accessed with the [`useNavigation`](use-navigation.md) hook. It's also passed as a prop to screens defined with the dynamic API.
85
66
86
-
For more details, see the ["Navigation prop document"](navigation-prop.md).
67
+
For more details, see the ["Navigation object docs"](navigation-object.md).
87
68
88
-
The ["Route prop reference"](route-prop.md) section goes into more detail on this, describes workarounds, and provides more information on other properties available on `route` prop.
69
+
The ["Route object reference"](route-object.md) section goes into more detail on this, describes workarounds, and provides more information on other properties available on `route` prop.
89
70
90
-
## Route Prop
71
+
## Route object
91
72
92
-
This prop will be passed to all screens. Contains information about current route i.e. `params`, `key` and `name`.
73
+
This prop will be passed to all screens. Contains information about the current route i.e. `params`, `key` and `name`. It can also contain arbitrary params:
74
+
75
+
```js
76
+
{
77
+
key:'B',
78
+
name:'Profile',
79
+
params: { id:'123' }
80
+
}
81
+
```
82
+
83
+
For more details, see the ["Route object reference"](route-object.md).
93
84
94
85
## Navigation State
95
86
@@ -110,18 +101,6 @@ For this navigation state, there are two routes (which may be tabs, or cards in
110
101
111
102
You can read more about the navigation state [here](navigation-state.md).
112
103
113
-
## Route
114
-
115
-
Each route is an object which contains a key to identify it, and a "name" to designate the type of route. It can also contain arbitrary params:
116
-
117
-
```js
118
-
{
119
-
key:'B',
120
-
name:'Profile',
121
-
params: { id:'123' }
122
-
}
123
-
```
124
-
125
104
## Header
126
105
127
106
Also known as navigation header, navigation bar, app bar, and probably many other things. This is the rectangle at the top of your screen that contains the back button and the title for your screen. The entire rectangle is often referred to as the header in React Navigation.
Copy file name to clipboardExpand all lines: versioned_docs/version-7.x/material-top-tab-navigator.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -75,7 +75,7 @@ The `Tab.Navigator` component accepts following props:
75
75
76
76
#### `id`
77
77
78
-
Optional unique ID for the navigator. This can be used with [`navigation.getParent`](navigation-prop.md#getparent) to refer to this navigator in a child navigator.
78
+
Optional unique ID for the navigator. This can be used with [`navigation.getParent`](navigation-object.md#getparent) to refer to this navigator in a child navigator.
79
79
80
80
#### `initialRouteName`
81
81
@@ -408,7 +408,7 @@ React.useEffect(() => {
408
408
409
409
### Helpers
410
410
411
-
The tab navigator adds the following methods to the navigation prop:
411
+
The tab navigator adds the following methods to the navigation object:
0 commit comments