Skip to content

Commit 79b27b2

Browse files
committed
Update static vs dynamic API docs
1 parent 53e901e commit 79b27b2

2 files changed

Lines changed: 10 additions & 12 deletions

File tree

versioned_docs/version-7.x/static-vs-dynamic.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,16 @@ sidebar_label: Static vs Dynamic API
66

77
React Navigation provides two ways to configure your navigation:
88

9-
- Static API - object-based configuration with automatic TypeScript types and deep linking
10-
- Dynamic API - component-based dynamic configuration
9+
- **Static** - object-based configuration with automatic TypeScript types and deep linking
10+
- **Dynamic** - component-based dynamic configuration
1111

1212
If you're already familiar with the dynamic API, this guide explains how each concept maps to the static API - whether you're migrating an existing app or just learning the static API.
1313

1414
## Limitations
1515

16-
Since the static API is designed for static configuration, there are some limitations to be aware of:
16+
The main limitation of the static API is that **the navigation structure must be static**. This means that you cannot create the list of screens dynamically.
1717

18-
- The navigation tree must be static - you cannot create the list of screens dynamically. However, you can [conditionally render screens using the `if` property](#conditional-screens).
19-
- React hooks cannot be used in `options`, `listeners` etc. However, [`React.use()`](https://react.dev/reference/react/use) can be used to read context values in `options` callback (though it may produce ESLint warnings since ESLint cannot detect that it runs during render), and you can use the `theme` parameter instead of `useTheme()`.
18+
It's still possible to use dynamic logic for other parts with [`if`](#conditional-screens), [`with`](#dynamic-navigator-props) etc.
2019

2120
## Basic usage
2221

@@ -68,7 +67,7 @@ The component returned by [`createStaticNavigation`](static-configuration.md#cre
6867

6968
## Navigation object
7069

71-
Screens no longer receive the `navigation` object as a prop in the static API. It's necessary to use the [`useNavigation`](use-navigation.md) hook instead:
70+
Screens do not receive the `navigation` object as a prop in the static API. It's necessary to use the [`useNavigation`](use-navigation.md) hook instead:
7271

7372
```js title="Dynamic API"
7473
function HomeScreen({ navigation }) {

versioned_docs/version-8.x/static-vs-dynamic.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,16 @@ sidebar_label: Static API vs Dynamic API
66

77
React Navigation provides two ways to configure your navigation:
88

9-
- Static API - object-based configuration with automatic TypeScript types and deep linking
10-
- Dynamic API - component-based dynamic configuration
9+
- **Static** - object-based configuration with automatic TypeScript types and deep linking
10+
- **Dynamic** - component-based dynamic configuration
1111

1212
If you're already familiar with the dynamic API, this guide explains how each concept maps to the static API - whether you're migrating an existing app or just learning the static API.
1313

1414
## Limitations
1515

16-
Since the static API is designed for static configuration, there are some limitations to be aware of:
16+
The main limitation of the static API is that **the navigation structure must be static**. This means that you cannot create the list of screens dynamically.
1717

18-
- The navigation tree must be static - you cannot create the list of screens dynamically. However, you can [conditionally render screens using the `if` property](#conditional-screens).
19-
- React hooks cannot be used in `options`, `listeners` etc. However, [`React.use()`](https://react.dev/reference/react/use) can be used to read context values in `options` callback (though it may produce ESLint warnings since ESLint cannot detect that it runs during render), and you can use the `theme` parameter instead of `useTheme()`.
18+
It's still possible to use dynamic logic for other parts with [`if`](#conditional-screens), [`with`](#dynamic-navigator-props) etc.
2019

2120
## Basic usage
2221

@@ -68,7 +67,7 @@ The component returned by [`createStaticNavigation`](static-configuration.md#cre
6867

6968
## Navigation object
7069

71-
Screens no longer receive the `navigation` object as a prop in the static API. It's necessary to use the [`useNavigation`](use-navigation.md) hook instead:
70+
Screens do not receive the `navigation` object as a prop in the static API. It's necessary to use the [`useNavigation`](use-navigation.md) hook instead:
7271

7372
```js title="Dynamic API"
7473
function HomeScreen({ navigation }) {

0 commit comments

Comments
 (0)