You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

rootNavigationContainerRef.js 539B

12345678910111213141516171819
  1. // @flow
  2. import React from 'react';
  3. // $FlowExpectedError
  4. export const rootNavigationRef = React.createRef();
  5. /**
  6. * User defined navigation action included inside the reference to the container.
  7. *
  8. * @param {string} name - Destination name of the route that has been defined somewhere.
  9. * @param {Object} params - Params to pass to the destination route.
  10. * @returns {Function}
  11. */
  12. export function navigateRoot(name: string, params: Object) {
  13. // $FlowExpectedError
  14. return rootNavigationRef.current?.navigate(name, params);
  15. }