2026-08-11 06:20:06 +00:00
// Module ID: 1534
// Function ID: 1535
2026-07-20 16:05:17 +00:00
// Name: context
2026-07-29 08:29:29 +00:00
// Dependencies: [19, 21]
2026-08-06 08:05:19 +00:00
// Exports: EnsureSingleNavigator
2026-07-20 16:05:17 +00:00
2026-08-11 06:20:06 +00:00
// Module 1534 (context)
2026-07-29 08:29:29 +00:00
import importAllResult from "noop" ;
2026-07-23 10:11:24 +00:00
import { jsx } from "jsxProd" ;
2026-07-29 08:29:29 +00:00
let c0 = importAllResult ;
2026-07-20 16:05:17 +00:00
const context = importAllResult . createContext ( undefined ) ;
2026-08-06 08:05:19 +00:00
export const SingleNavigatorContext = context ;
export const EnsureSingleNavigator = function EnsureSingleNavigator ( children ) {
2026-07-29 08:29:29 +00:00
let importAllResult ;
2026-08-06 08:05:19 +00:00
importAllResult = importAllResult . useRef ( undefined ) ;
2026-07-23 10:11:24 +00:00
return < context . Provider value = { importAllResult . useMemo ( ( ) => ( {
2026-07-20 16:05:17 +00:00
register ( current ) {
2026-07-29 08:29:29 +00:00
current = ref . current ;
2026-07-20 16:05:17 +00:00
if ( undefined !== current ) {
if ( current !== current ) {
const _Error = Error ;
const error = new Error ( "Another navigator is already registered for this container. You likely have multiple navigators under a single \"NavigationContainer\" or \"Screen\". Make sure each navigator is under a separate \"Screen\" container. See https://reactnavigation.org/docs/nesting-navigators for a guide on nesting." ) ;
throw error ;
}
}
2026-07-29 08:29:29 +00:00
ref . current = current ;
2026-07-20 16:05:17 +00:00
} ,
unregister ( arg0 ) {
2026-07-29 08:29:29 +00:00
if ( arg0 === ref . current ) {
tmp . current = undefined ;
2026-07-20 16:05:17 +00:00
}
}
} ) , [ ] ) } > { arg0 . children } < / c o n t e x t . P r o v i d e r > ;
} ;