Skip to content

Commit ae75bde

Browse files
committed
Document the pop option for navigate
1 parent 53a0b08 commit ae75bde

File tree

5 files changed

+13
-5
lines changed

5 files changed

+13
-5
lines changed

versioned_docs/version-7.x/native-stack-navigator.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1351,7 +1351,8 @@ Navigates back to a previous screen in the stack by popping screens after it. Th
13511351

13521352
- `name` - _string_ - Name of the route to navigate to.
13531353
- `params` - _object_ - Screen params to pass to the destination route.
1354-
- `merge` - _boolean_ - Whether params should be merged with the existing route params, or replace them (when navigating to an existing screen). Defaults to `false`.
1354+
- `options` - Options object containing the following properties:
1355+
- `merge` - _boolean_ - Whether params should be merged with the existing route params, or replace them (when navigating to an existing screen). Defaults to `false`.
13551356

13561357
If a matching screen is not found in the stack, this will pop the current screen and add a new screen with the specified name and params.
13571358

versioned_docs/version-7.x/navigation-actions.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ The `navigate` action allows to navigate to a specific route. It takes the follo
2828

2929
- `name` - _string_ - A destination name of the screen in the current or a parent navigator.
3030
- `params` - _object_ - Params to use for the destination route.
31-
- `merge` - _boolean_ - Whether params should be merged with the existing route params, or replace them (when navigating to an existing screen). Defaults to `false`.
31+
- `options` - Options object containing the following properties:
32+
- `merge` - _boolean_ - Whether params should be merged with the existing route params, or replace them (when navigating to an existing screen). Defaults to `false`.
33+
- `pop` - _boolean_ - Whether screens should be popped to navigate to a matching screen in the stack. Defaults to `false`.
3234

3335
<Tabs groupId="config" queryString="config">
3436
<TabItem value="static" label="Static" default>
@@ -292,6 +294,7 @@ The `navigate` action can also accepts an object as the argument with the follow
292294
- `name` - _string_ - A destination name of the screen in the current or a parent navigator
293295
- `params` - _object_ - Params to use for the destination route.
294296
- `merge` - _boolean_ - Whether params should be merged with the existing route params, or replace them (when navigating to an existing screen). Defaults to `false`.
297+
- `pop` - _boolean_ - Whether screens should be popped to navigate to a matching screen in the stack. Defaults to `false`.
295298
- `path` - _string_ - The path (from deep link or universal link) to associate with the screen.
296299
297300
This is primarily used internally to associate a path with a screen when it's from a URL.

versioned_docs/version-7.x/navigation-object.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,9 @@ The `navigate` method lets us navigate to another screen in your app. It takes t
7676

7777
- `name` - _string_ - A destination name of the screen in the current or a parent navigator.
7878
- `params` - _object_ - Params to use for the destination route.
79-
- `merge` - _boolean_ - Whether params should be merged with the existing route params, or replace them (when navigating to an existing screen). Defaults to `false`.
79+
- `options` - Options object containing the following properties:
80+
- `merge` - _boolean_ - Whether params should be merged with the existing route params, or replace them (when navigating to an existing screen). Defaults to `false`.
81+
- `pop` - _boolean_ - Whether screens should be popped to navigate to a matching screen in the stack. Defaults to `false`.
8082

8183
<Tabs groupId="config" queryString="config">
8284
<TabItem value="static" label="Static" default>

versioned_docs/version-7.x/stack-actions.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,8 @@ The method accepts the following arguments:
534534

535535
- `name` - _string_ - Name of the route to navigate to.
536536
- `params` - _object_ - Screen params to pass to the destination route.
537-
- `merge` - _boolean_ - Whether params should be merged with the existing route params, or replace them (when navigating to an existing screen). Defaults to `false`.
537+
- `options` - Options object containing the following properties:
538+
- `merge` - _boolean_ - Whether params should be merged with the existing route params, or replace them (when navigating to an existing screen). Defaults to `false`.
538539

539540
```js
540541
import { StackActions } from '@react-navigation/native';

versioned_docs/version-7.x/stack-navigator.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,8 @@ Navigates back to a previous screen in the stack by popping screens after it. Th
587587

588588
- `name` - _string_ - Name of the route to navigate to.
589589
- `params` - _object_ - Screen params to pass to the destination route.
590-
- `merge` - _boolean_ - Whether params should be merged with the existing route params, or replace them (when navigating to an existing screen). Defaults to `false`.
590+
- `options` - Options object containing the following properties:
591+
- `merge` - _boolean_ - Whether params should be merged with the existing route params, or replace them (when navigating to an existing screen). Defaults to `false`.
591592

592593
If a matching screen is not found in the stack, this will pop the current screen and add a new screen with the specified name and params.
593594

0 commit comments

Comments
 (0)