Skip to content

Commit dc5d112

Browse files
committed
Revert "Add some notes about navigation with keys"
This reverts commit 9b3b597.
1 parent 67ebc85 commit dc5d112

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

docs/navigating.md

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ Let's suppose that we actually *want* to add another details screen. This is pre
8484
title="Go to Details... again"
8585
onPress={() => this.props.navigation.push('Details')}
8686
/>
87+
}
8788
```
8889

8990
<a href="https://snack.expo.io/@react-navigation/pushing-details-v2" target="blank" class="run-code-button">&rarr; Run this code</a>
@@ -126,17 +127,6 @@ class DetailsScreen extends React.Component {
126127
127128
Another common requirement is to be able to go back _multiple_ screens -- for example, if you are several screens deep in a stack and want to dismiss all of them to go back to the first screen. In this case, we know that we want to go back to `Home` so we can use `navigate('Home')` (not `push`! try that out and see the difference). Another alternative would be `navigation.popToTop()`, which goes back to the first screen in the stack.
128129

129-
Navigation actions behave idempotently when called with a key. When pushing, the navigator will push a route with that key. If the route already exists, it will navigate to that route and set the params.
130-
131-
```js
132-
<Button
133-
title="Go to Details... but don't push it to the stack if it already exists, just navigate"
134-
onPress={() => this.props.navigation.navigate({ routeName: 'Details', key: 'myKey' })}
135-
/>
136-
```
137-
138-
In a StackNavigator, you can set the key for initial route by passing `initialRouteKey` to the stack configs object if needed.
139-
140130
## Summary
141131

142132
* `this.props.navigation.navigate('RouteName')` pushes a new route to the stack navigator if it's not already in the stack, otherwise it jumps to that screen.

0 commit comments

Comments
 (0)