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:
andry-baka 2017-09-16 04:43:35 +07:00 committed by Spencer Carli
parent 3ad142b818
commit 500c8a07ac

View File

@ -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 ## `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. Use dispatch to send any navigation action to the router. The other navigation functions use dispatch behind the scenes.