Add previous scene to tabBarOnPress - fix #2787 (#2790)

* Add previous scene to tabBarOnPress - fix #2787

* Update docs for tabBarOnPress
This commit is contained in:
pietro909
2017-11-19 23:00:10 +01:00
committed by Spencer Carli
parent 4e48d43f0f
commit 88dfd84cf5
4 changed files with 33 additions and 11 deletions

View File

@@ -177,7 +177,13 @@ Title string of a tab displayed in the tab bar or React Element or a function th
#### `tabBarOnPress`
Callback to handle tap events; arguments are the `scene: { route, index }` that was tapped and a `jumpToIndex` method that can perform the navigation for you.
Callback to handle tap events; the argument is an object containing:
* the `previousScene: { route, index }` which is the scene we are leaving
* the `scene: { route, index }` that was tapped
* the `jumpToIndex` method that can perform the navigation for you
Useful for adding a custom logic before the transition to the next scene (the tapped one) starts.
### Navigator Props