Skip to content

Commit 1c98ae0

Browse files
committed
Fix description for popTo
1 parent e08a83b commit 1c98ae0

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -528,15 +528,13 @@ export default function App() {
528528

529529
The `popTo` action takes you back to a previous screen in the stack by the name. It also allows you to pass params to the route.
530530

531-
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. This behavior is useful when the screen was opened from a deep link etc. and a previous screen with the name may or may not already be in the stack.
531+
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 - essentially behaving like a [`replace`](#replace). This ensures that the app doesn't break if a previous screen with the name did not exist - which can happen when the screen was opened from a deep link or push notification, or when used on the web etc.
532532

533533
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.
537537

538-
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. This behavior is useful when the screen was opened from a deep link and a previous screen with the name may or may not already be in the stack.
539-
540538
```js
541539
import { StackActions } from '@react-navigation/native';
542540

0 commit comments

Comments
 (0)