|
@@ -16,6 +16,7 @@ class PushedScreen extends Component {
|
16
|
16
|
this.onClickPop = this.onClickPop.bind(this);
|
17
|
17
|
this.onClickPopPrevious = this.onClickPopPrevious.bind(this);
|
18
|
18
|
this.onClickPopToFirstPosition = this.onClickPopToFirstPosition.bind(this);
|
|
19
|
+ this.onClickPopToRoot = this.onClickPopToRoot.bind(this);
|
19
|
20
|
}
|
20
|
21
|
render() {
|
21
|
22
|
const stackPosition = this.getStackPosition();
|
|
@@ -26,6 +27,7 @@ class PushedScreen extends Component {
|
26
|
27
|
<Button title="Push" onPress={this.onClickPush} />
|
27
|
28
|
<Button title="Pop" onPress={this.onClickPop} />
|
28
|
29
|
<Button title="Pop Previous" onPress={this.onClickPopPrevious} />
|
|
30
|
+ <Button title="Pop To Root" onPress={this.onClickPopToRoot} />
|
29
|
31
|
{stackPosition > 2 && <Button title="Pop To Stack Position 1" onPress={this.onClickPopToFirstPosition} />}
|
30
|
32
|
<Text style={styles.footer}>{`this.props.id = ${this.props.id}`}</Text>
|
31
|
33
|
</View>
|
|
@@ -54,6 +56,10 @@ class PushedScreen extends Component {
|
54
|
56
|
Navigation.on(this.props.id).popTo(this.props.previousScreenIds[0]);
|
55
|
57
|
}
|
56
|
58
|
|
|
59
|
+ onClickPopToRoot() {
|
|
60
|
+ Navigation.on(this.props.id).popToRoot();
|
|
61
|
+ }
|
|
62
|
+
|
57
|
63
|
getStackPosition() {
|
58
|
64
|
return this.props.stackPosition || 1;
|
59
|
65
|
}
|