import { createNavigationContainerRef } from "@react-navigation/native";

export const navigationRef = createNavigationContainerRef()

export function navigate(name, params?) {
  if (navigationRef.isReady()) {
    console.log("[Navigation]: Using global navigation to switch to screen: " + name)
    navigationRef.navigate(name as never, params as never);
  }
  else {
    console.log("[Navigation]: Global navigation isn't ready.")
  }
}
