Skip to content

Commit 032e8d5

Browse files
committed
Merge static configuration section with rest
1 parent 6765a7c commit 032e8d5

File tree

5 files changed

+13
-16
lines changed

5 files changed

+13
-16
lines changed

versioned_docs/version-7.x/static-combine-with-dynamic.md renamed to versioned_docs/version-7.x/combine-static-with-dynamic.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
2-
id: static-combine-with-dynamic
2+
id: combine-static-with-dynamic
33
title: Combining static and dynamic APIs
4-
sidebar_label: Combining with dynamic API
4+
sidebar_label: Combining static and dynamic APIs
55
---
66

77
While the static API has many advantages, it doesn't fit use cases where the navigation configuration needs to be dynamic. So React Navigation supports interop between the static and dynamic APIs.

versioned_docs/version-7.x/nesting-navigators.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1039,7 +1039,7 @@ We recommend to reduce nesting navigators to minimal. Try to achieve the behavio
10391039
- Nesting same type of navigators (e.g. tabs inside tabs, drawer inside drawer etc.) might lead to a confusing UX
10401040
- With excessive nesting, code becomes difficult to follow when navigating to nested screens, configuring deep link etc.
10411041

1042-
Think of nesting navigators as a way to achieve the UI you want rather than a way to organize your code. If you want to create separate group of screens for organization, instead of using separate navigators, you can use the [`Group`](group.md) component for dynamic configuration or [`groups` property](static-api-reference.md#groups) for static configuration.
1042+
Think of nesting navigators as a way to achieve the UI you want rather than a way to organize your code. If you want to create separate group of screens for organization, instead of using separate navigators, you can use the [`Group`](group.md) component for dynamic configuration or [`groups` property](static-configuration.md#groups) for static configuration.
10431043

10441044
<Tabs groupId="config" queryString="config">
10451045
<TabItem value="static" label="Static" default>

versioned_docs/version-7.x/static-authentication.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ This is the behavior that we want from the authentication flow: when users sign
2626
We can configure different screens to be available based on some condition. For example, if the user is signed in, we can define `Home`, `Profile`, `Settings` etc. If the user is not signed in, we can define `SignIn` and `SignUp` screens. To do this, we need a couple of things:
2727

2828
1. Define two hooks: `useIsSignedIn` and `useIsSignedOut`, which return a boolean value indicating whether the user is signed in or not.
29-
2. Use the `useIsSignedIn` and `useIsSignedOut` along with the [`if`](static-api-reference.md#if) property to define the screens that are available based on the condition.
29+
2. Use the `useIsSignedIn` and `useIsSignedOut` along with the [`if`](static-configuration.md#if) property to define the screens that are available based on the condition.
3030

3131
This tells React Navigation to show specific screens based on the signed in status. When the signed in status changes, React Navigation will automatically show the appropriate screen.
3232

@@ -113,7 +113,7 @@ In the above snippet, `isLoading` means that we're still checking if we have a t
113113

114114
Next, we're exposing the sign in status via the `SignInContext` so that it's available to the `useIsSignedIn` and `useIsSignedOut` hooks.
115115

116-
In the above example, we're have one screen for each case. But you could also define multiple screens. For example, you probably want to define password reset, signup, etc screens as well when the user isn't signed in. Similarly for the screens accessible after sign in, you probably have more than one screen. We can use [`groups`](static-api-reference.md#groups) to define multiple screens:
116+
In the above example, we're have one screen for each case. But you could also define multiple screens. For example, you probably want to define password reset, signup, etc screens as well when the user isn't signed in. Similarly for the screens accessible after sign in, you probably have more than one screen. We can use [`groups`](static-configuration.md#groups) to define multiple screens:
117117

118118
```js
119119
const RootStack = createNativeStackNavigator({

versioned_docs/version-7.x/static-api-reference.md renamed to versioned_docs/version-7.x/static-configuration.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
2-
id: static-api-reference
3-
title: Static API Reference
4-
sidebar_label: API Reference
2+
id: static-configuration
3+
title: Static configuration
4+
sidebar_label: Static configuration
55
---
66

77
The bulk of the static configuration is done using the `createXNavigator` functions, e.g. [`createNativeStackNavigator`](native-stack-navigator.md), [`createBottomTabNavigator`](bottom-tab-navigator.md), [`createDrawerNavigator`](drawer-navigator.md) etc. We'll refer to these functions as `createXNavigator` in the rest of this guide.
@@ -167,7 +167,7 @@ const RootStack = createNativeStackNavigator({
167167

168168
The `linking` object supports the same configuration options described in [Configuring links](configuring-links.md) such as `parse`, `stringify` and `exact`.
169169

170-
To make deep links work on native apps, you also need to [configure your app](deep-linking.md) and pass `prefixes` to the navigation component returned by [`createStaticNavigation`](static-api-reference.md#createstaticnavigation):
170+
To make deep links work on native apps, you also need to [configure your app](deep-linking.md) and pass `prefixes` to the navigation component returned by [`createStaticNavigation`](static-configuration.md#createstaticnavigation):
171171

172172
```js
173173
const Navigation = createStaticNavigation(RootStack);
@@ -322,7 +322,7 @@ const RootStackNavigator = createComponentForStaticNavigation(RootStack, 'RootNa
322322

323323
The returned component doesn't take any props. All of the configuration is inferred from the static config. It's essentially the same as defining a component using the dynamic API.
324324

325-
This looks similar to `createStaticNavigation` however they are very different. When using static configuration, you'd never use this function directly. The only time you'd use this is if you're migrating away from static configuration and want to reuse existing code you wrote instead of rewriting it to the dynamic API. See [Combining static and dynamic APIs](static-combine-with-dynamic.md) for more details.
325+
This looks similar to `createStaticNavigation` however they are very different. When using static configuration, you'd never use this function directly. The only time you'd use this is if you're migrating away from static configuration and want to reuse existing code you wrote instead of rewriting it to the dynamic API. See [Combining static and dynamic APIs](combine-static-with-dynamic.md) for more details.
326326

327327
## `createPathConfigForStaticNavigation`
328328

@@ -338,4 +338,4 @@ const config = {
338338
};
339339
```
340340

341-
Similar to `createComponentForStaticNavigation`, this is intended to be used when migrating away from static configuration. See [Combining static and dynamic APIs](static-combine-with-dynamic.md) for more details.
341+
Similar to `createComponentForStaticNavigation`, this is intended to be used when migrating away from static configuration. See [Combining static and dynamic APIs](combine-static-with-dynamic.md) for more details.

versioned_sidebars/version-7.x-sidebars.json

+2-5
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,14 @@
3333
"screen-tracking",
3434
"themes",
3535
"state-persistence",
36+
"combine-static-with-dynamic",
3637
"testing",
3738
"typescript",
3839
"redux-integration",
3940
"MST-integration",
4041
"troubleshooting",
4142
"upgrading-from-6.x"
4243
],
43-
"Static configuration": [
44-
"static-api-reference",
45-
"static-authentication",
46-
"static-combine-with-dynamic"
47-
],
4844
"Navigators": [
4945
"stack-navigator",
5046
"native-stack-navigator",
@@ -59,6 +55,7 @@
5955
"drawer-layout"
6056
],
6157
"API reference": [
58+
"static-configuration",
6259
"navigation-container",
6360
"server-container",
6461
"group",

0 commit comments

Comments
 (0)