import { NavigationContainerRef } from "@react-navigation/core" ; import { StackActionType } from "@react-navigation/native" ; import * as React from "react" ; import { NavigatorRoutes , RouteNavigationOptions , Routes } from "./Routes" ; export class NavigationHelper { static appContainerRef = React . createRef < NavigationContainerRef > ( ) ; static navigateTo ( options ) { this . appContainerRef . current ?. navigate ( options . screen , options . params ) ; } static showModal ( options ) { const action = { type : "PUSH" , payload : { name : options . screen , params : options . params , } , } ; this . appContainerRef . current ?. dispatch ( action ) ; } }