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/auth-flow.md
+19-21Lines changed: 19 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -88,11 +88,11 @@ This means:
88
88
89
89
This makes it impossible to navigate to the `Home` when the user is not signed in, and to `SignIn` when the user is signed in.
90
90
91
-
When the values returned by `useIsSignedin` and `useIsSignedOut` change, the screens matching the condition will change:
91
+
When the values returned by `useIsSignedIn` and `useIsSignedOut` change, the screens matching the condition will change:
92
92
93
-
- Let's say, initially `useIsSignedOut` returns `true`. This means that `SignIn`screens is shown.
93
+
- Let's say, initially `useIsSignedOut` returns `true`. This means that the `SignIn`screen is shown.
94
94
- After the user signs in, the return value of `useIsSignedIn` will change to `true` and `useIsSignedOut` will change to `false`, which means:
95
-
- React Navigation will see that the `SignIn` screen is no longer matches the condition, so it will remove the screen.
95
+
- React Navigation will see that the `SignIn` screen no longer matches the condition, so it will remove the screen.
96
96
- Then it'll show the `Home` screen automatically because that's the first screen available when `useIsSignedIn` returns `true`.
97
97
98
98
The order of the screens matters when there are multiple screens matching the condition. For example, if there are two screens matching `useIsSignedIn`, the first screen will be shown when the condition is `true`.
@@ -170,14 +170,14 @@ This means:
170
170
171
171
This makes it impossible to navigate to the `Home` when the user is not signed in, and to `SignIn` when the user is signed in.
172
172
173
-
When the value of `isSignedin` changes, the screens defined based on the condition will change:
173
+
When the value of `isSignedIn` changes, the screens defined based on the condition will change:
174
174
175
-
- Let's say, initially `isSignedin` is `false`. This means that `SignIn`screens is shown.
176
-
- After the user signs in, the value of `isSignedin` will change to `true`, which means:
175
+
- Let's say, initially `isSignedIn` is `false`. This means that the `SignIn`screen is shown.
176
+
- After the user signs in, the value of `isSignedIn` will change to `true`, which means:
177
177
- React Navigation will see that the `SignIn` screen is no longer defined, so it will remove the screen.
178
-
- Then it'll show the `Home` screen automatically because that's the first screen defined when `isSignedin` returns `true`.
178
+
- Then it'll show the `Home` screen automatically because that's the first screen defined when `isSignedIn` returns `true`.
179
179
180
-
The order of the screens matters when there are multiple screens matching the condition. For example, if there are two screens defined based on `isSignedin`, the first screen will be shown when the condition is `true`.
180
+
The order of the screens matters when there are multiple screens matching the condition. For example, if there are two screens defined based on `isSignedIn`, the first screen will be shown when the condition is `true`.
181
181
182
182
</TabItem>
183
183
</Tabs>
@@ -228,16 +228,15 @@ export default function App() {
- Linking configuration for the screens in the top tab navigator.
62
-
- TypeScript types for the screens in the top tab navigator.
61
+
- Linking configuration for the screens in the bottom tab navigator.
62
+
- TypeScript types for the screens in the bottom tab navigator.
63
63
64
64
Since the nested navigator is defined using the dynamic API, we need to handle these manually. For the linking configuration, we can define the screens in the `linking` property of the `Feed` screen:
Copy file name to clipboardExpand all lines: versioned_docs/version-7.x/community-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
@@ -4,7 +4,7 @@ title: Community navigators
4
4
sidebar_label: Community navigators
5
5
---
6
6
7
-
This guide lists various community navigators for React Navigation. These navigators offer provide UI components for navigation with the familiar React Navigation API.
7
+
This guide lists various community navigators for React Navigation. These navigators provide UI components for navigation with the familiar React Navigation API.
8
8
9
9
If you're looking to build your own navigator, check out the [custom navigators guide](custom-navigators.md).
@@ -927,7 +927,7 @@ By default, paths defined for each screen are matched against the URL relative t
927
927
const ProfileTabs = createBottomTabNavigator({
928
928
screens: {
929
929
Profile: {
930
-
screen:HomeScreen,
930
+
screen:ProfileScreen,
931
931
linking: {
932
932
path:'users/:id',
933
933
},
@@ -979,7 +979,7 @@ In this case, it makes more sense to navigate to the `Profile` screen using a UR
979
979
constProfileTabs=createBottomTabNavigator({
980
980
screens: {
981
981
Profile: {
982
-
screen:HomeScreen,
982
+
screen:ProfileScreen,
983
983
linking: {
984
984
path:'users/:id',
985
985
// highlight-next-line
@@ -1037,13 +1037,13 @@ Sometimes, you may not want to have the route name of a screen in the path. For
1037
1037
constRootStack=createStackNavigator({
1038
1038
screens: {
1039
1039
Home: {
1040
-
screen:ProfileScreen,
1040
+
screen:HomeScreen,
1041
1041
linking: {
1042
1042
path:'home',
1043
1043
},
1044
1044
},
1045
1045
Profile: {
1046
-
screen:HomeScreen,
1046
+
screen:ProfileScreen,
1047
1047
linking: {
1048
1048
path:'users/:id',
1049
1049
},
@@ -1080,13 +1080,13 @@ You can specify an empty string as path or not specify a path at all, and React
1080
1080
constRootStack=createStackNavigator({
1081
1081
screens: {
1082
1082
Home: {
1083
-
screen:ProfileScreen,
1083
+
screen:HomeScreen,
1084
1084
linking: {
1085
1085
path:'',
1086
1086
},
1087
1087
},
1088
1088
Profile: {
1089
-
screen:HomeScreen,
1089
+
screen:ProfileScreen,
1090
1090
linking: {
1091
1091
path:'users/:id',
1092
1092
},
@@ -1194,7 +1194,7 @@ const config = {
1194
1194
</TabItem>
1195
1195
</Tabs>
1196
1196
1197
-
You can also provide a your own function to serialize the params. For example, let's say that you want to use a DD-MM-YYYY format in the path instead of a timestamp:
1197
+
You can also provide your own function to serialize the params. For example, let's say that you want to use a DD-MM-YYYY format in the path instead of a timestamp:
@@ -1254,7 +1256,7 @@ Depending on your requirements, you can use this functionality to parse and stri
1254
1256
1255
1257
If you need more complex matching logic, you can use regular expressions to match the path. For example, if you want to use the pattern `@username` to match a user's profile, you can use a regular expression to match the path. This allows you to have the same path pattern for multiple screens, but fine-tune the matching logic to be more specific for a particular screen.
1256
1258
1257
-
Regular expressions can be specified between parentheses `(` and `)`in the after a param name. For example:
1259
+
Regular expressions can be specified between parentheses `(` and `)` after a param name. For example:
The [example app](https://github.com/react-navigation/react-navigation/tree/main/packages/example) includes a variety of patterns and is used as a simple way for contributors to manually integration test changes.
137
+
The [example app](https://github.com/react-navigation/react-navigation/tree/main/example) includes a variety of patterns and is used as a simple way for contributors to manually integration test changes.
138
138
139
139
While developing, you can run the [example app](https://github.com/react-navigation/react-navigation/tree/main/example) with [Expo](https://expo.io/) to test your changes:
0 commit comments