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.

ConferenceNavigationContainerRef.js 1.1KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. // @flow
  2. import React from 'react';
  3. // $FlowExpectedError
  4. export const conferenceNavigationRef = 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 navigate(name: string, params: Object) {
  13. // $FlowExpectedError
  14. return conferenceNavigationRef.current?.navigate(name, params);
  15. }
  16. /**
  17. * User defined navigation action included inside the reference to the container.
  18. *
  19. * @returns {Function}
  20. */
  21. export function goBack() {
  22. // $FlowExpectedError
  23. return conferenceNavigationRef.current?.goBack();
  24. }
  25. /**
  26. * User defined navigation action included inside the reference to the container.
  27. *
  28. * @param {Object} params - Params to pass to the destination route.
  29. * @returns {Function}
  30. */
  31. export function setParams(params: Object) {
  32. // $FlowExpectedError
  33. return conferenceNavigationRef.current?.setParams(params);
  34. }