|
@@ -26,6 +26,7 @@ class ModalScreen extends Component {
|
26
|
26
|
this.onClickDismissAllModals = this.onClickDismissAllModals.bind(this);
|
27
|
27
|
this.onClickPushScreen = this.onClickPushScreen.bind(this);
|
28
|
28
|
this.onShowModalWithDeepStack = this.onShowModalWithDeepStack.bind(this);
|
|
29
|
+ this.onClickModalLifecycle = this.onClickModalLifecycle.bind(this);
|
29
|
30
|
}
|
30
|
31
|
|
31
|
32
|
render() {
|
|
@@ -37,6 +38,7 @@ class ModalScreen extends Component {
|
37
|
38
|
<Button title='Dismiss Modal' testID={testIDs.DISMISS_MODAL_BUTTON} onPress={this.onClickDismissModal} />
|
38
|
39
|
<Button title='Dismiss Unknown Modal' testID={testIDs.DISMISS_UNKNOWN_MODAL_BUTTON} onPress={this.onClickDismissUnknownModal} />
|
39
|
40
|
<Button title='Dismiss All Modals' testID={testIDs.DISMISS_ALL_MODALS_BUTTON} onPress={this.onClickDismissAllModals} />
|
|
41
|
+ <Button title='Test Modal Lifecycle' testID={testIDs.MODAL_LIFECYCLE_BUTTON} onPress={this.onClickModalLifecycle} />
|
40
|
42
|
<Button title='Push screen' testID={testIDs.PUSH_BUTTON} onPress={this.onClickPushScreen} />
|
41
|
43
|
<Button title='Show Modal With Stack' testID={testIDs.MODAL_WITH_STACK_BUTTON} onPress={this.onShowModalWithDeepStack} />
|
42
|
44
|
{this.getPreviousModalId() ? (<Button title='Dismiss Previous Modal' testID={testIDs.DISMISS_PREVIOUS_MODAL_BUTTON}
|
|
@@ -89,6 +91,20 @@ class ModalScreen extends Component {
|
89
|
91
|
Navigation.dismissAllModals();
|
90
|
92
|
}
|
91
|
93
|
|
|
94
|
+ onClickModalLifecycle() {
|
|
95
|
+ Navigation.showModal({
|
|
96
|
+ component: {
|
|
97
|
+ name: 'navigation.playground.LifecycleScreen',
|
|
98
|
+ passProps: {
|
|
99
|
+ isModal: true,
|
|
100
|
+ },
|
|
101
|
+ options: {
|
|
102
|
+ animated: false
|
|
103
|
+ }
|
|
104
|
+ }
|
|
105
|
+ });
|
|
106
|
+ }
|
|
107
|
+
|
92
|
108
|
onClickPushScreen() {
|
93
|
109
|
Navigation.push(this.props.componentId, {
|
94
|
110
|
component: {
|