Skip to content
This repository was archived by the owner on Oct 2, 2019. It is now read-only.

Commit a6cef45

Browse files
committed
Reset route stack with this.props.reset()
Close #30
1 parent 67a508f commit a6cef45

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ var Router = React.createClass({
6060
this.onBack(navigator);
6161
}.bind(this);
6262

63+
var goToFirstRoute = function() {
64+
navigator.popToTop()
65+
};
66+
6367
var customAction = function(opts) {
6468
this.customAction(opts);
6569
}.bind(this);
@@ -103,6 +107,7 @@ var Router = React.createClass({
103107
data={route.data}
104108
toRoute={goForward}
105109
toBack={goBackwards}
110+
reset={goToFirstRoute}
106111
customAction={customAction}
107112
/>
108113
</View>

0 commit comments

Comments
 (0)