|
@@ -202,6 +202,33 @@ function navigatorPopToRoot(navigator, params) {
|
202
|
202
|
});
|
203
|
203
|
}
|
204
|
204
|
|
|
205
|
+function navigatorResetTo(navigator, params) {
|
|
206
|
+ if (!params.screen) {
|
|
207
|
+ console.error('Navigator.resetTo(params): params.screen is required');
|
|
208
|
+ return;
|
|
209
|
+ }
|
|
210
|
+ const screenInstanceID = utils.getRandomId();
|
|
211
|
+ const {
|
|
212
|
+ navigatorStyle,
|
|
213
|
+ navigatorButtons,
|
|
214
|
+ navigatorEventID
|
|
215
|
+ } = _mergeScreenSpecificSettings(params.screen, screenInstanceID, params);
|
|
216
|
+ const passProps = Object.assign({}, params.passProps);
|
|
217
|
+ passProps.navigatorID = navigator.navigatorID;
|
|
218
|
+ passProps.screenInstanceID = screenInstanceID;
|
|
219
|
+ passProps.navigatorEventID = navigatorEventID;
|
|
220
|
+ passProps.listenForEvents = !!(navigatorButtons.leftButtons || navigatorButtons.rightButtons);
|
|
221
|
+ Controllers.NavigationControllerIOS(navigator.navigatorID).resetTo({
|
|
222
|
+ title: params.title,
|
|
223
|
+ component: params.screen,
|
|
224
|
+ animated: params.animated,
|
|
225
|
+ passProps: passProps,
|
|
226
|
+ style: navigatorStyle,
|
|
227
|
+ leftButtons: navigatorButtons.leftButtons,
|
|
228
|
+ rightButtons: navigatorButtons.rightButtons
|
|
229
|
+ });
|
|
230
|
+}
|
|
231
|
+
|
205
|
232
|
function navigatorSetTitle(navigator, params) {
|
206
|
233
|
Controllers.NavigationControllerIOS(navigator.navigatorID).setTitle({
|
207
|
234
|
title: params.title
|
|
@@ -280,6 +307,7 @@ export default platformSpecific = {
|
280
|
307
|
navigatorPush,
|
281
|
308
|
navigatorPop,
|
282
|
309
|
navigatorPopToRoot,
|
|
310
|
+ navigatorResetTo,
|
283
|
311
|
showModal,
|
284
|
312
|
dismissModal,
|
285
|
313
|
navigatorSetButtons,
|