mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2024-11-19 18:00:17 +01:00
16 lines
477 B
TypeScript
16 lines
477 B
TypeScript
import { createNavigationContainerRef, ParamListBase, NavigationAction } from '@react-navigation/native';
|
|
|
|
export const navigationRef = createNavigationContainerRef<ParamListBase>();
|
|
|
|
export function navigate(name: string, params?: ParamListBase) {
|
|
if (navigationRef.isReady()) {
|
|
navigationRef.current?.navigate(name, params);
|
|
}
|
|
}
|
|
|
|
export function dispatch(action: NavigationAction) {
|
|
if (navigationRef.isReady()) {
|
|
navigationRef.current?.dispatch(action);
|
|
}
|
|
}
|