UNPKG

@react-navigation/core

Version:

Core utilities for building navigators

69 lines (67 loc) • 3.14 kB
"use strict"; import * as React from 'react'; import { NavigationBuilderContext } from "./NavigationBuilderContext.js"; import { NavigationContainerRefContext } from "./NavigationContainerRefContext.js"; import { NavigationContext } from "./NavigationContext.js"; import { NavigationFocusedRouteStateContext } from "./NavigationFocusedRouteStateContext.js"; import { NavigationHelpersContext } from "./NavigationHelpersContext.js"; import { NavigationIndependentTreeContext } from "./NavigationIndependentTreeContext.js"; // eslint-disable-next-line import-x/no-deprecated import { NavigationMetaContext } from "./NavigationMetaContext.js"; import { NamedRouteContextListContext, NavigationRouteContext } from "./NavigationProvider.js"; import { PreventRemoveContext } from "./PreventRemoveContext.js"; import { FocusedRouteKeyContext, IsFocusedContext } from "./useIsFocused.js"; import { NavigationStateListenerContext } from "./useNavigationState.js"; /** * Component to make the child navigation container independent of parent containers. */ import { jsx as _jsx } from "react/jsx-runtime"; export function NavigationIndependentTree({ children }) { return ( /*#__PURE__*/ // We need to clear any existing contexts for nested independent container to work correctly _jsx(NavigationIndependentTreeContext.Provider, { value: true, children: /*#__PURE__*/_jsx(NavigationContainerRefContext.Provider, { value: undefined, children: /*#__PURE__*/_jsx(NavigationBuilderContext.Provider, { value: undefined, children: /*#__PURE__*/_jsx(NavigationMetaContext.Provider, { value: undefined, children: /*#__PURE__*/_jsx(NavigationHelpersContext.Provider, { value: undefined, children: /*#__PURE__*/_jsx(NavigationStateListenerContext.Provider, { value: undefined, children: /*#__PURE__*/_jsx(FocusedRouteKeyContext.Provider, { value: undefined, children: /*#__PURE__*/_jsx(PreventRemoveContext.Provider, { value: undefined, children: /*#__PURE__*/_jsx(NamedRouteContextListContext.Provider, { value: undefined, children: /*#__PURE__*/_jsx(NavigationRouteContext.Provider, { value: undefined, children: /*#__PURE__*/_jsx(NavigationContext.Provider, { value: undefined, children: /*#__PURE__*/_jsx(IsFocusedContext.Provider, { value: undefined, children: /*#__PURE__*/_jsx(NavigationFocusedRouteStateContext.Provider, { value: undefined, children: children }) }) }) }) }) }) }) }) }) }) }) }) }) ); } //# sourceMappingURL=NavigationIndependentTree.js.map