Skip to content

Commit c0f1f9c

Browse files
authored
Make button description less confusing
1 parent 5ea4427 commit c0f1f9c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

docs/navigating.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,14 @@ class DetailsScreen extends React.Component {
126126
127127
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.
128128

129-
Navigation actions always behave idempotently. If you are not using `^2.0.0`, navigation actions behave idempotently only 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.
129+
Navigation actions always behave idempotently in `2.x.x`. If you are still using `1.x.x`, navigation actions behave idempotently only 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.
130130

131131
```js
132132
<Button
133-
title="Go to Details... but don't push it to the stack if it already exists, just navigate"
133+
title="Go to Details..."
134+
// in 2.x.x
135+
onPress={() => this.props.navigation.navigate('Details')}
136+
// in 1.x.x
134137
onPress={() => this.props.navigation.navigate({ routeName: 'Details', key: 'myKey' })}
135138
/>
136139
```

0 commit comments

Comments
 (0)