UNPKG

26.8 kBSource Map (JSON)View Raw
1{"version":3,"names":["CommonActions","React","checkDuplicateRouteNames","checkSerializable","NOT_INITIALIZED_ERROR","EnsureSingleNavigator","findFocusedRoute","NavigationBuilderContext","NavigationContainerRefContext","NavigationContext","NavigationRouteContext","NavigationStateContext","UnhandledActionContext","useChildListeners","useEventEmitter","useKeyedChildListeners","useOptionsGetters","ScheduleUpdateContext","useSyncState","serializableWarnings","duplicateNameWarnings","getPartialState","state","undefined","key","routeNames","partialState","stale","routes","map","route","BaseNavigationContainer","forwardRef","ref","initialState","onStateChange","onUnhandledAction","independent","children","parent","useContext","isDefault","Error","getState","setState","scheduleUpdate","flushUpdates","isFirstMountRef","useRef","navigatorKeyRef","getKey","useCallback","current","setKey","listeners","addListener","keyedListeners","addKeyedListener","dispatch","action","focus","console","error","navigation","canGoBack","result","handled","resetRoot","target","root","reset","getRootState","getCurrentRoute","emitter","addOptionsGetter","getCurrentOptions","useMemo","Object","keys","reduce","acc","name","create","isFocused","getParent","stateRef","isReady","useImperativeHandle","onDispatchAction","noop","emit","type","data","stack","stackRef","lastEmittedOptionsRef","onOptionsChange","options","builderContext","scheduleContext","isInitialRef","getIsInitial","context","onStateChangeRef","useEffect","hydratedState","process","env","NODE_ENV","serializableResult","serializable","location","reason","path","pointer","params","i","length","curr","prev","test","JSON","stringify","message","includes","push","warn","duplicateRouteNamesResult","locations","join","defaultOnUnhandledAction","payload","element"],"sources":["BaseNavigationContainer.tsx"],"sourcesContent":["import {\n CommonActions,\n InitialState,\n NavigationAction,\n NavigationState,\n ParamListBase,\n PartialState,\n Route,\n} from '@react-navigation/routers';\nimport * as React from 'react';\n\nimport checkDuplicateRouteNames from './checkDuplicateRouteNames';\nimport checkSerializable from './checkSerializable';\nimport { NOT_INITIALIZED_ERROR } from './createNavigationContainerRef';\nimport EnsureSingleNavigator from './EnsureSingleNavigator';\nimport findFocusedRoute from './findFocusedRoute';\nimport NavigationBuilderContext from './NavigationBuilderContext';\nimport NavigationContainerRefContext from './NavigationContainerRefContext';\nimport NavigationContext from './NavigationContext';\nimport NavigationRouteContext from './NavigationRouteContext';\nimport NavigationStateContext from './NavigationStateContext';\nimport type {\n NavigationContainerEventMap,\n NavigationContainerProps,\n NavigationContainerRef,\n} from './types';\nimport UnhandledActionContext from './UnhandledActionContext';\nimport useChildListeners from './useChildListeners';\nimport useEventEmitter from './useEventEmitter';\nimport useKeyedChildListeners from './useKeyedChildListeners';\nimport useOptionsGetters from './useOptionsGetters';\nimport { ScheduleUpdateContext } from './useScheduleUpdate';\nimport useSyncState from './useSyncState';\n\ntype State = NavigationState | PartialState<NavigationState> | undefined;\n\nconst serializableWarnings: string[] = [];\nconst duplicateNameWarnings: string[] = [];\n\n/**\n * Remove `key` and `routeNames` from the state objects recursively to get partial state.\n *\n * @param state Initial state object.\n */\nconst getPartialState = (\n state: InitialState | undefined\n): PartialState<NavigationState> | undefined => {\n if (state === undefined) {\n return;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { key, routeNames, ...partialState } = state;\n\n return {\n ...partialState,\n stale: true,\n routes: state.routes.map((route) => {\n if (route.state === undefined) {\n return route as Route<string> & {\n state?: PartialState<NavigationState>;\n };\n }\n\n return { ...route, state: getPartialState(route.state) };\n }),\n };\n};\n\n/**\n * Container component which holds the navigation state.\n * This should be rendered at the root wrapping the whole app.\n *\n * @param props.initialState Initial state object for the navigation tree.\n * @param props.onStateChange Callback which is called with the latest navigation state when it changes.\n * @param props.children Child elements to render the content.\n * @param props.ref Ref object which refers to the navigation object containing helper methods.\n */\nconst BaseNavigationContainer = React.forwardRef(\n function BaseNavigationContainer(\n {\n initialState,\n onStateChange,\n onUnhandledAction,\n independent,\n children,\n }: NavigationContainerProps,\n ref?: React.Ref<NavigationContainerRef<ParamListBase>>\n ) {\n const parent = React.useContext(NavigationStateContext);\n\n if (!parent.isDefault && !independent) {\n throw new Error(\n \"Looks like you have nested a 'NavigationContainer' inside another. Normally you need only one container at the root of the app, so this was probably an error. If this was intentional, pass 'independent={true}' explicitly. Note that this will make the child navigators disconnected from the parent and you won't be able to navigate between them.\"\n );\n }\n\n const [state, getState, setState, scheduleUpdate, flushUpdates] =\n useSyncState<State>(() =>\n getPartialState(initialState == null ? undefined : initialState)\n );\n\n const isFirstMountRef = React.useRef<boolean>(true);\n\n const navigatorKeyRef = React.useRef<string | undefined>();\n\n const getKey = React.useCallback(() => navigatorKeyRef.current, []);\n\n const setKey = React.useCallback((key: string) => {\n navigatorKeyRef.current = key;\n }, []);\n\n const { listeners, addListener } = useChildListeners();\n\n const { keyedListeners, addKeyedListener } = useKeyedChildListeners();\n\n const dispatch = React.useCallback(\n (\n action:\n | NavigationAction\n | ((state: NavigationState) => NavigationAction)\n ) => {\n if (listeners.focus[0] == null) {\n console.error(NOT_INITIALIZED_ERROR);\n } else {\n listeners.focus[0]((navigation) => navigation.dispatch(action));\n }\n },\n [listeners.focus]\n );\n\n const canGoBack = React.useCallback(() => {\n if (listeners.focus[0] == null) {\n return false;\n }\n\n const { result, handled } = listeners.focus[0]((navigation) =>\n navigation.canGoBack()\n );\n\n if (handled) {\n return result;\n } else {\n return false;\n }\n }, [listeners.focus]);\n\n const resetRoot = React.useCallback(\n (state?: PartialState<NavigationState> | NavigationState) => {\n const target = state?.key ?? keyedListeners.getState.root?.().key;\n\n if (target == null) {\n console.error(NOT_INITIALIZED_ERROR);\n } else {\n listeners.focus[0]((navigation) =>\n navigation.dispatch({\n ...CommonActions.reset(state),\n target,\n })\n );\n }\n },\n [keyedListeners.getState, listeners.focus]\n );\n\n const getRootState = React.useCallback(() => {\n return keyedListeners.getState.root?.();\n }, [keyedListeners.getState]);\n\n const getCurrentRoute = React.useCallback(() => {\n const state = getRootState();\n\n if (state == null) {\n return undefined;\n }\n\n const route = findFocusedRoute(state);\n\n return route as Route<string> | undefined;\n }, [getRootState]);\n\n const emitter = useEventEmitter<NavigationContainerEventMap>();\n\n const { addOptionsGetter, getCurrentOptions } = useOptionsGetters({});\n\n const navigation: NavigationContainerRef<ParamListBase> = React.useMemo(\n () => ({\n ...Object.keys(CommonActions).reduce<any>((acc, name) => {\n acc[name] = (...args: any[]) =>\n // @ts-expect-error: this is ok\n dispatch(CommonActions[name](...args));\n return acc;\n }, {}),\n ...emitter.create('root'),\n dispatch,\n resetRoot,\n isFocused: () => true,\n canGoBack,\n getParent: () => undefined,\n getState: () => stateRef.current,\n getRootState,\n getCurrentRoute,\n getCurrentOptions,\n isReady: () => listeners.focus[0] != null,\n }),\n [\n canGoBack,\n dispatch,\n emitter,\n getCurrentOptions,\n getCurrentRoute,\n getRootState,\n listeners.focus,\n resetRoot,\n ]\n );\n\n React.useImperativeHandle(ref, () => navigation, [navigation]);\n\n const onDispatchAction = React.useCallback(\n (action: NavigationAction, noop: boolean) => {\n emitter.emit({\n type: '__unsafe_action__',\n data: { action, noop, stack: stackRef.current },\n });\n },\n [emitter]\n );\n\n const lastEmittedOptionsRef = React.useRef<object | undefined>();\n\n const onOptionsChange = React.useCallback(\n (options: object) => {\n if (lastEmittedOptionsRef.current === options) {\n return;\n }\n\n lastEmittedOptionsRef.current = options;\n\n emitter.emit({\n type: 'options',\n data: { options },\n });\n },\n [emitter]\n );\n\n const stackRef = React.useRef<string | undefined>();\n\n const builderContext = React.useMemo(\n () => ({\n addListener,\n addKeyedListener,\n onDispatchAction,\n onOptionsChange,\n stackRef,\n }),\n [addListener, addKeyedListener, onDispatchAction, onOptionsChange]\n );\n\n const scheduleContext = React.useMemo(\n () => ({ scheduleUpdate, flushUpdates }),\n [scheduleUpdate, flushUpdates]\n );\n\n const isInitialRef = React.useRef(true);\n\n const getIsInitial = React.useCallback(() => isInitialRef.current, []);\n\n const context = React.useMemo(\n () => ({\n state,\n getState,\n setState,\n getKey,\n setKey,\n getIsInitial,\n addOptionsGetter,\n }),\n [\n state,\n getState,\n setState,\n getKey,\n setKey,\n getIsInitial,\n addOptionsGetter,\n ]\n );\n\n const onStateChangeRef = React.useRef(onStateChange);\n const stateRef = React.useRef(state);\n\n React.useEffect(() => {\n isInitialRef.current = false;\n onStateChangeRef.current = onStateChange;\n stateRef.current = state;\n });\n\n React.useEffect(() => {\n const hydratedState = getRootState();\n\n if (process.env.NODE_ENV !== 'production') {\n if (hydratedState !== undefined) {\n const serializableResult = checkSerializable(hydratedState);\n\n if (!serializableResult.serializable) {\n const { location, reason } = serializableResult;\n\n let path = '';\n let pointer: Record<any, any> = hydratedState;\n let params = false;\n\n for (let i = 0; i < location.length; i++) {\n const curr = location[i];\n const prev = location[i - 1];\n\n pointer = pointer[curr];\n\n if (!params && curr === 'state') {\n continue;\n } else if (!params && curr === 'routes') {\n if (path) {\n path += ' > ';\n }\n } else if (\n !params &&\n typeof curr === 'number' &&\n prev === 'routes'\n ) {\n path += pointer?.name;\n } else if (!params) {\n path += ` > ${curr}`;\n params = true;\n } else {\n if (typeof curr === 'number' || /^[0-9]+$/.test(curr)) {\n path += `[${curr}]`;\n } else if (/^[a-z$_]+$/i.test(curr)) {\n path += `.${curr}`;\n } else {\n path += `[${JSON.stringify(curr)}]`;\n }\n }\n }\n\n const message = `Non-serializable values were found in the navigation state. Check:\\n\\n${path} (${reason})\\n\\nThis can break usage such as persisting and restoring state. This might happen if you passed non-serializable values such as function, class instances etc. in params. If you need to use components with callbacks in your options, you can use 'navigation.setOptions' instead. See https://reactnavigation.org/docs/troubleshooting#i-get-the-warning-non-serializable-values-were-found-in-the-navigation-state for more details.`;\n\n if (!serializableWarnings.includes(message)) {\n serializableWarnings.push(message);\n console.warn(message);\n }\n }\n\n const duplicateRouteNamesResult =\n checkDuplicateRouteNames(hydratedState);\n\n if (duplicateRouteNamesResult.length) {\n const message = `Found screens with the same name nested inside one another. Check:\\n${duplicateRouteNamesResult.map(\n (locations) => `\\n${locations.join(', ')}`\n )}\\n\\nThis can cause confusing behavior during navigation. Consider using unique names for each screen instead.`;\n\n if (!duplicateNameWarnings.includes(message)) {\n duplicateNameWarnings.push(message);\n console.warn(message);\n }\n }\n }\n }\n\n emitter.emit({ type: 'state', data: { state } });\n\n if (!isFirstMountRef.current && onStateChangeRef.current) {\n onStateChangeRef.current(hydratedState);\n }\n\n isFirstMountRef.current = false;\n }, [getRootState, emitter, state]);\n\n const defaultOnUnhandledAction = React.useCallback(\n (action: NavigationAction) => {\n if (process.env.NODE_ENV === 'production') {\n return;\n }\n\n const payload: Record<string, any> | undefined = action.payload;\n\n let message = `The action '${action.type}'${\n payload ? ` with payload ${JSON.stringify(action.payload)}` : ''\n } was not handled by any navigator.`;\n\n switch (action.type) {\n case 'NAVIGATE':\n case 'PUSH':\n case 'REPLACE':\n case 'JUMP_TO':\n if (payload?.name) {\n message += `\\n\\nDo you have a screen named '${payload.name}'?\\n\\nIf you're trying to navigate to a screen in a nested navigator, see https://reactnavigation.org/docs/nesting-navigators#navigating-to-a-screen-in-a-nested-navigator.`;\n } else {\n message += `\\n\\nYou need to pass the name of the screen to navigate to.\\n\\nSee https://reactnavigation.org/docs/navigation-actions for usage.`;\n }\n\n break;\n case 'GO_BACK':\n case 'POP':\n case 'POP_TO_TOP':\n message += `\\n\\nIs there any screen to go back to?`;\n break;\n case 'OPEN_DRAWER':\n case 'CLOSE_DRAWER':\n case 'TOGGLE_DRAWER':\n message += `\\n\\nIs your screen inside a Drawer navigator?`;\n break;\n }\n\n message += `\\n\\nThis is a development-only warning and won't be shown in production.`;\n\n console.error(message);\n },\n []\n );\n\n let element = (\n <NavigationContainerRefContext.Provider value={navigation}>\n <ScheduleUpdateContext.Provider value={scheduleContext}>\n <NavigationBuilderContext.Provider value={builderContext}>\n <NavigationStateContext.Provider value={context}>\n <UnhandledActionContext.Provider\n value={onUnhandledAction ?? defaultOnUnhandledAction}\n >\n <EnsureSingleNavigator>{children}</EnsureSingleNavigator>\n </UnhandledActionContext.Provider>\n </NavigationStateContext.Provider>\n </NavigationBuilderContext.Provider>\n </ScheduleUpdateContext.Provider>\n </NavigationContainerRefContext.Provider>\n );\n\n if (independent) {\n // We need to clear any existing contexts for nested independent container to work correctly\n element = (\n <NavigationRouteContext.Provider value={undefined}>\n <NavigationContext.Provider value={undefined}>\n {element}\n </NavigationContext.Provider>\n </NavigationRouteContext.Provider>\n );\n }\n\n return element;\n }\n);\n\nexport default BaseNavigationContainer;\n"],"mappings":"AAAA,SACEA,aADF,QAQO,2BARP;AASA,OAAO,KAAKC,KAAZ,MAAuB,OAAvB;AAEA,OAAOC,wBAAP,MAAqC,4BAArC;AACA,OAAOC,iBAAP,MAA8B,qBAA9B;AACA,SAASC,qBAAT,QAAsC,gCAAtC;AACA,OAAOC,qBAAP,MAAkC,yBAAlC;AACA,OAAOC,gBAAP,MAA6B,oBAA7B;AACA,OAAOC,wBAAP,MAAqC,4BAArC;AACA,OAAOC,6BAAP,MAA0C,iCAA1C;AACA,OAAOC,iBAAP,MAA8B,qBAA9B;AACA,OAAOC,sBAAP,MAAmC,0BAAnC;AACA,OAAOC,sBAAP,MAAmC,0BAAnC;AAMA,OAAOC,sBAAP,MAAmC,0BAAnC;AACA,OAAOC,iBAAP,MAA8B,qBAA9B;AACA,OAAOC,eAAP,MAA4B,mBAA5B;AACA,OAAOC,sBAAP,MAAmC,0BAAnC;AACA,OAAOC,iBAAP,MAA8B,qBAA9B;AACA,SAASC,qBAAT,QAAsC,qBAAtC;AACA,OAAOC,YAAP,MAAyB,gBAAzB;AAIA,MAAMC,oBAA8B,GAAG,EAAvC;AACA,MAAMC,qBAA+B,GAAG,EAAxC;AAEA;AACA;AACA;AACA;AACA;;AACA,MAAMC,eAAe,GACnBC,KADsB,IAEwB;EAC9C,IAAIA,KAAK,KAAKC,SAAd,EAAyB;IACvB;EACD,CAH6C,CAK9C;;;EACA,MAAM;IAAEC,GAAF;IAAOC,UAAP;IAAmB,GAAGC;EAAtB,IAAuCJ,KAA7C;EAEA,OAAO,EACL,GAAGI,YADE;IAELC,KAAK,EAAE,IAFF;IAGLC,MAAM,EAAEN,KAAK,CAACM,MAAN,CAAaC,GAAb,CAAkBC,KAAD,IAAW;MAClC,IAAIA,KAAK,CAACR,KAA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