mirror of
https://github.com/status-im/react-navigation.git
synced 2025-02-24 17:18:09 +00:00
Doc Improvement: goBack key doc improvement (#2035)
* chore(Doc Improvement): goBack key doc improvement * chore(Doc improvement): fix wording * chore(Doc Improvement): fix uppercase/lowercase wording
This commit is contained in:
parent
3ad142b818
commit
500c8a07ac
@ -116,6 +116,26 @@ class HomeScreen extends React.Component {
|
||||
}
|
||||
```
|
||||
|
||||
*Going back from a specific screen*
|
||||
|
||||
Consider the following navigation stack history:
|
||||
```...
|
||||
navigation.navigate(SCREEN_KEY_A);
|
||||
...
|
||||
navigation.navigate(SCREEN_KEY_B);
|
||||
...
|
||||
navigation.navigate(SCREEN_KEY_C);
|
||||
...
|
||||
navigation.navigate(SCREEN_KEY_D);
|
||||
```
|
||||
|
||||
Now you are on *screen D* and want to go back to *screen A* (popping D, C, and B).
|
||||
Then you need to supply a key to goBack *FROM*:
|
||||
|
||||
```
|
||||
navigation.goBack(SCREEN_KEY_B) // will go to screen A FROM screen B
|
||||
```
|
||||
|
||||
## `dispatch` - Send an action to the router
|
||||
|
||||
Use dispatch to send any navigation action to the router. The other navigation functions use dispatch behind the scenes.
|
||||
|
Loading…
x
Reference in New Issue
Block a user