How to use the react-native-navigation.Navigation.popToRoot function in react-native-navigation

To help you get started, we’ve selected a few react-native-navigation examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github d14na / zeronet-explorer / src / frames / Camera.js View on Github external
_close() {
        /* Close the webview. */
        Navigation.popToRoot('zeronet.Main').catch(console.log);
    }
github birkir / hekla / src / screens / index.ts View on Github external
topBar: {
          title: {
            text: prettyNumber(descendants, 'Comments'),
          },
        },
        preview: reactTag ? {
          reactTag,
          commit: true,
        } : undefined,
      },
    },
  } as any;

  if (isSplitView && isMasterView) {
    // Pop to root
    await Navigation.popToRoot(UI.iPadDetailComponentId);
    // Switch to first tab
    await Navigation.mergeOptions(UI.iPadDetailComponentId, { bottomTabs: { currentTabIndex: 0 } });
    return when(
      // Wait for detail view to appear
      () => UI.componentId === UI.iPadDetailComponentId,
      // Then push new controller
      () => Navigation.push(UI.iPadDetailComponentId, opts),
    );
  }

  return Navigation.push(UI.componentId, opts);
};
github wix / react-native-navigation / playground / src / screens / PushedScreen.js View on Github external
async onClickPopToRoot() {
    await Navigation.popToRoot(this.props.componentId);
  }
github raindropio / mobile / src / modules / navigation / index.js View on Github external
popToRoot({ componentId }) {
        return Navigation.popToRoot(componentId)
    },
github wix / react-native-navigation / playground / src / services / Navigation.js View on Github external
const popToRoot = (self) => Navigation.popToRoot(self.props.componentId);
github forest-watcher / forest-watcher / app / components / form / index.js View on Github external
navigationButtonPressed({ buttonId }) {
    if (buttonId === 'backButton') {
      if (this.props.nextQuestionIndex !== null || !this.props.editMode) {
        Navigation.dismissModal(this.props.componentId);
      } else {
        Navigation.popToRoot(this.props.componentId);
      }
    }
  }
github forest-watcher / forest-watcher / app / components / form / index.js View on Github external
setReportAnswer(reportName, answer, updateOnly);
    }
    if (nextQuestionIndex !== null) {
      Navigation.push(componentId, {
        component: {
          name: 'ForestWatcher.NewReport',
          passProps: {
            editMode,
            reportName,
            questionIndex: nextQuestionIndex
          }
        }
      });
    } else {
      if (editMode) {
        Navigation.popToRoot(componentId);
      } else {
        Navigation.push(componentId, {
          component: {
            name: 'ForestWatcher.Answers',
            passProps: {
              reportName
            }
          }
        });
      }
    }
  });
github uport-project / uport-mobile / lib / components / Backup / DataBackupSuccess.js View on Github external
              onPress={() => Navigation.popToRoot(this.props.componentId)}>
              {'Done'}