您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

SettingsNavigationContainerRef.ts 805B

123456789101112131415161718192021222324
  1. import { NavigationContainerRef } from '@react-navigation/native';
  2. import React from 'react';
  3. export const settingsNavigationContainerRef = React.createRef<NavigationContainerRef<any>>();
  4. /**
  5. * User defined navigation action included inside the reference to the container.
  6. *
  7. * @param {string} name - Destination name of the route that has been defined somewhere.
  8. * @param {Object} params - Params to pass to the destination route.
  9. * @returns {Function}
  10. */
  11. export function navigate(name: string, params: Object) {
  12. return settingsNavigationContainerRef.current?.navigate(name, params);
  13. }
  14. /**
  15. * User defined navigation action included inside the reference to the container.
  16. *
  17. * @returns {Function}
  18. */
  19. export function goBack() {
  20. return settingsNavigationContainerRef.current?.goBack();
  21. }