let __rootNavigationElement = null ; export function navigate ( target , props ? ) { if ( __rootNavigationElement ) { __rootNavigationElement . navigate ( target , props ) ; } } export function navigateBack ( ) { if ( __rootNavigationElement ) { __rootNavigationElement . goBack ( ) ; } } export function navigateBackToRoot ( ) { if ( __rootNavigationElement ) { while ( __rootNavigationElement . canGoBack ( ) ) { try { __rootNavigationElement . goBack ( ) ; } catch ( err ) { } } } } export function rootNavigationRef ( newNode ) { __rootNavigationElement = newNode ; }