expo-router 6.0.0-beta.4 → 6.0.0-beta.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,7 +3,7 @@
3
3
  flex-direction: column;
4
4
  flex: 1;
5
5
  pointer-events: auto;
6
- border: var(--expo-router-modal-border, 1px solid rgba(61.2, 61.2, 66, 0.29));
6
+ border: var(--expo-router-modal-border, none);
7
7
  box-sizing: border-box;
8
8
  overflow: auto;
9
9
  will-change: transform;
@@ -19,20 +19,21 @@
19
19
  .modal {
20
20
  position: relative;
21
21
  z-index: 50;
22
- /* Default width 580px (iPad modals) but responsive up to 90vw unless overridden */
23
- width: var(--expo-router-modal-width, 580px);
22
+ /* iOS 26 modal dimensions: 83% width with max 936px, 79% height with max 586px */
23
+ width: var(--expo-router-modal-width, 83vw);
24
24
  min-width: var(--expo-router-modal-min-width, auto);
25
- /* If --expo-router-modal-width is provided use that, otherwise default clamp */
26
- max-width: var(--expo-router-modal-max-width, 90vw);
27
- /* Clamp height so modal never exceeds viewport minus 2rem padding */
28
- max-height: min(var(--expo-router-modal-height, 640px), calc(100dvh - 2rem));
25
+ /* Max width follows iOS 26 specifications */
26
+ max-width: var(--expo-router-modal-max-width, min(936px, 83vw));
27
+ /* iOS 26 height: 79% with max 586px, accounting for viewport padding */
28
+ height: var(--expo-router-modal-height, 79dvh);
29
+ max-height: min(var(--expo-router-modal-height, min(586px, 79dvh)), calc(100dvh - 2rem));
29
30
  /* Ensure modal retains a reasonable minimum but never bigger than viewport */
30
- min-height: min(var(--expo-router-modal-min-height, var(--expo-router-modal-height, 640px)), calc(100dvh - 2rem));
31
+ min-height: min(var(--expo-router-modal-min-height, var(--expo-router-modal-height, min(586px, 79dvh))), calc(100dvh - 2rem));
31
32
  /*
32
33
  It is super expensive to calculate the shadow with box-shadow, so we have to use filter instead.
33
34
  Do not change this to box-shadow. Box-shadow caused an INP of 600ms on the modal.
34
35
  */
35
- filter: drop-shadow(0 10px 8px rgb(0 0 0 / 0.04)) drop-shadow(0 4px 3px rgb(0 0 0 / 0.1));
36
+ filter: var(--expo-router-modal-shadow, drop-shadow(0 10px 8px rgb(0 0 0 / 0.04)) drop-shadow(0 4px 3px rgb(0 0 0 / 0.1)));
36
37
  overflow: auto;
37
38
  outline: none;
38
39
  }
@@ -116,17 +117,17 @@ body>.transparentDrawerContent {
116
117
  left: 50%;
117
118
  top: 50%;
118
119
  transform: translate(-50%, -50%);
119
- /* Use the same sizing variables as the primary desktop rule */
120
- width: var(--expo-router-modal-width, 580px);
120
+ /* Use the same sizing variables as the primary desktop rule - iOS 26 dimensions */
121
+ width: var(--expo-router-modal-width, 83vw);
121
122
  min-width: var(--expo-router-modal-min-width, auto);
122
- max-width: var(--expo-router-modal-max-width, 90vw);
123
+ max-width: var(--expo-router-modal-max-width, min(936px, 83vw));
123
124
  margin: 0;
124
125
  /*
125
126
  It is super expensive to calculate the shadow with box-shadow, so we have to use filter instead.
126
127
  Do not change this to box-shadow. Box-shadow caused an INP of 600ms on the modal.
127
128
  */
128
- filter: drop-shadow(0px 25px 50px rgba(0, 0, 0, 0.3));
129
- border-radius: var(--expo-router-modal-border-radius, 10px);
129
+ filter: var(--expo-router-modal-shadow, drop-shadow(0px 25px 50px rgba(0, 0, 0, 0.3)));
130
+ border-radius: var(--expo-router-modal-border-radius, 24px);
130
131
  }
131
132
 
132
133
  .srOnly {
@@ -38,6 +38,11 @@ export type ExtendedStackNavigationOptions = NativeStackNavigationOptions & {
38
38
  * @platform web
39
39
  */
40
40
  overlayBackground?: string;
41
+ /**
42
+ * Override the modal shadow filter (any valid CSS filter value, e.g. 'drop-shadow(0 4px 8px rgba(0,0,0,0.1))' or 'none').
43
+ * @platform web
44
+ */
45
+ shadow?: string;
41
46
  };
42
47
  };
43
48
  declare const RNStack: import("react").ForwardRefExoticComponent<Omit<Omit<import("@react-navigation/native-stack").NativeStackNavigatorProps, "children" | "layout" | "initialRouteName" | "id" | "screenListeners" | "screenOptions" | "screenLayout" | "UNSTABLE_router"> & import("@react-navigation/native").DefaultRouterOptions<string> & {
@@ -1 +1 @@
1
- {"version":3,"file":"StackClient.d.ts","sourceRoot":"","sources":["../../src/layouts/StackClient.tsx"],"names":[],"mappings":"AACA,OAAO,EAGL,aAAa,EAKb,WAAW,IAAI,aAAa,EAE5B,oBAAoB,EACpB,KAAK,SAAS,EACf,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,6BAA6B,EAC7B,4BAA4B,EAC7B,MAAM,gCAAgC,CAAC;AAExC,OAAO,EAAE,cAAc,EAAW,MAAM,OAAO,CAAC;AAOhD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAM/C;;;GAGG;AACH,MAAM,MAAM,8BAA8B,GAAG,4BAA4B,GAAG;IAC1E,aAAa,CAAC,EAAE;QACd;;;WAGG;QACH,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;QACxB;;;WAGG;QACH,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;QACzB;;;WAGG;QACH,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;QAC5B;;;WAGG;QACH,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;QAC3B;;;WAGG;QACH,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB;;;WAGG;QACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;KAC5B,CAAC;CACH,CAAC;AAEF,QAAA,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAKU,CAAC;AA+BxB;;;;;;;;GAQG;AACH,eAAO,MAAM,mBAAmB,EAAE,WAAW,CAAC,cAAc,CAAC,OAAO,OAAO,CAAC,CAAC,iBAAiB,CAAC,CAqT9F,CAAC;AA8DF,QAAA,MAAM,KAAK,WACD,cAAc,CAAC,OAAO,OAAO,CAAC;YAcV,CACxB,K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B,OAAO;oBACL,GAAG,UAAU;oBACb,SAAS,EAAE,MAAM;iBAClB,CAAC;YACJ,CAAC;YACD,OAAO,UAAU,IAAI,EAAE,CAAC;QAC1B,CAAC,CAAC;IACJ,CAAC;IACD,OAAO,CAAC,KAAK,EAAE,EAAE;QACf,IAAI,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC;YAC3B,OAAO;gBACL,GAAG,CAAC,OAAO,IAAI,EAAE,CAAC;gBAClB,SAAS,EAAE,MAAM;aAClB,CAAC;QACJ,CAAC;QACD,OAAO,OAAO,IAAI,EAAE,CAAC;IACvB,CAAC,CAAC;AACJ,CAAC;AAED,SAAS,mCAAmC,CAAC,KAAuC;IAClF,MAAM,UAAU,GAAG,IAAA,8CAA2B,EAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAC7D,OAAO,CAAC,CAAC,UAAU,CAAC,mCAAmC,CAAC;AAC1D,CAAC;AAED,kBAAe,KAAK,CAAC;AAEd,MAAM,WAAW,GAAyB,CAAC,OAAO,EAAE,EAAE;IAC3D,MAAM,MAAM,GAAG,IAAA,oBAAa,EAAC,OAAO,CAAC,CAAC;IACtC,OAAO;QACL,GAAG,MAAM;QACT,GAAG,IAAA,2BAAmB,EAAC,MAAM,CAAC;KAC/B,CAAC;AACJ,CAAC,CAAC;AANW,QAAA,WAAW,eAMtB","sourcesContent":["'use client';\nimport {\n CommonNavigationAction,\n NavigationAction,\n ParamListBase,\n PartialRoute,\n PartialState,\n Route,\n RouterConfigOptions,\n StackRouter as RNStackRouter,\n StackActionType,\n StackNavigationState,\n type RouteProp,\n} from '@react-navigation/native';\nimport {\n NativeStackNavigationEventMap,\n NativeStackNavigationOptions,\n} from '@react-navigation/native-stack';\nimport { nanoid } from 'nanoid/non-secure';\nimport { ComponentProps, useMemo } from 'react';\n\nimport { withLayoutContext } from './withLayoutContext';\nimport { createNativeStackNavigator } from '../fork/native-stack/createNativeStackNavigator';\nimport { useLinkPreviewContext } from '../link/preview/LinkPreviewContext';\nimport { getInternalExpoRouterParams, type InternalExpoRouterParams } from '../navigationParams';\nimport { SingularOptions, getSingularId } from '../useScreens';\nimport { Protected } from '../views/Protected';\n\ntype GetId = NonNullable<RouterConfigOptions['routeGetIdList'][string]>;\n\nconst NativeStackNavigator = createNativeStackNavigator().Navigator;\n\n/**\n * We extend NativeStackNavigationOptions with our custom props\n * to allow for several extra props to be used on web, like modalWidth\n */\nexport type ExtendedStackNavigationOptions = NativeStackNavigationOptions & {\n webModalStyle?: {\n /**\n * Override the width of the modal (px or percentage). Only applies on web platform.\n * @platform web\n */\n width?: number | string;\n /**\n * Override the height of the modal (px or percentage). Applies on web desktop.\n * @platform web\n */\n height?: number | string;\n /**\n * Minimum height of the desktop modal (px or percentage). Overrides the default 640px clamp.\n * @platform web\n */\n minHeight?: number | string;\n /**\n * Minimum width of the desktop modal (px or percentage). Overrides the default 580px.\n * @platform web\n */\n minWidth?: number | string;\n /**\n * Override the border of the desktop modal (any valid CSS border value, e.g. '1px solid #ccc' or 'none').\n * @platform web\n */\n border?: string;\n /**\n * Override the overlay background color (any valid CSS color or rgba/hsla value).\n * @platform web\n */\n overlayBackground?: string;\n };\n};\n\nconst RNStack = withLayoutContext<\n ExtendedStackNavigationOptions,\n typeof NativeStackNavigator,\n StackNavigationState<ParamListBase>,\n NativeStackNavigationEventMap\n>(NativeStackNavigator);\n\ntype RNNavigationAction = Extract<CommonNavigationAction, { type: 'NAVIGATE' }>;\ntype RNPreloadAction = Extract<CommonNavigationAction, { type: 'PRELOAD' }>;\ntype ExpoNavigationAction = Omit<RNNavigationAction, 'payload'> & {\n payload: Omit<RNNavigationAction['payload'], 'params'> & {\n params: RNNavigationAction['payload']['params'] & InternalExpoRouterParams;\n };\n};\n\nfunction isStackAction(\n action: NavigationAction\n): action is StackActionType | RNPreloadAction | ExpoNavigationAction {\n return (\n action.type === 'PUSH' ||\n action.type === 'NAVIGATE' ||\n action.type === 'POP' ||\n action.type === 'POP_TO_TOP' ||\n action.type === 'REPLACE' ||\n action.type === 'PRELOAD'\n );\n}\n\nconst isPreviewAction = (action: NavigationAction): action is ExpoNavigationAction =>\n !!action.payload &&\n 'params' in action.payload &&\n typeof action.payload.params === 'object' &&\n !!getInternalExpoRouterParams(action.payload?.params ?? undefined)[\n '__internal__expo_router_is_preview_navigation'\n ];\n\n/**\n * React Navigation matches a screen by its name or a 'getID' function that uniquely identifies a screen.\n * When a screen has been uniquely identified, the Stack can only have one instance of that screen.\n *\n * Expo Router allows for a screen to be matched by name and path params, a 'getID' function or a singular id.\n *\n * Instead of reimplementing the entire StackRouter, we can override the getStateForAction method to handle the singular screen logic.\n *\n */\nexport const stackRouterOverride: NonNullable<ComponentProps<typeof RNStack>['UNSTABLE_router']> = (\n original\n) => {\n return {\n getStateForAction: (state, action, options) => {\n if (action.target && action.target !== state.key) {\n return null;\n }\n\n if (!isStackAction(action)) {\n return original.getStateForAction(state, action, options);\n }\n\n // The dynamic getId added to an action, `router.push('screen', { singular: true })`\n const actionSingularOptions =\n action.payload && 'singular' in action.payload\n ? (action.payload.singular as SingularOptions)\n : undefined;\n\n // Handle if 'getID' or 'singular' is set.\n function getIdFunction(): GetId | undefined {\n // Actions can be fired by the user, so we do need to validate their structure.\n if (\n !('payload' in action) ||\n !action.payload ||\n !('name' in action.payload) ||\n typeof action.payload.name !== 'string'\n ) {\n return;\n }\n\n const actionName = action.payload.name;\n\n return (\n // The dynamic singular added to an action, `router.push('screen', { singular: () => 'id' })`\n getActionSingularIdFn(actionSingularOptions, actionName) ||\n // The static getId added as a prop to `<Screen singular />` or `<Screen getId={} />`\n options.routeGetIdList[actionName]\n );\n }\n\n const { routeParamList } = options;\n\n switch (action.type) {\n case 'PUSH':\n case 'NAVIGATE': {\n if (!state.routeNames.includes(action.payload.name)) {\n return null;\n }\n\n // START FORK\n const getId = getIdFunction();\n // const getId = options.routeGetIdList[action.payload.name];\n // END FORK\n const id = getId?.({ params: action.payload.params });\n\n let route: Route<string> | undefined;\n\n if (id !== undefined) {\n route = state.routes.findLast(\n (route) =>\n route.name === action.payload.name && id === getId?.({ params: route.params })\n );\n } else if (action.type === 'NAVIGATE') {\n const currentRoute = state.routes[state.index];\n\n // If the route matches the current one, then navigate to it\n if (action.payload.name === currentRoute.name) {\n route = currentRoute;\n } else if (action.payload.pop) {\n route = state.routes.findLast((route) => route.name === action.payload.name);\n }\n }\n\n // START FORK\n if (isPreviewAction(action) && !route) {\n route = state.preloadedRoutes.find(\n (route) => route.name === action.payload.name && id === route.key\n );\n }\n // END FORK\n\n if (!route) {\n route = state.preloadedRoutes.find(\n (route) =>\n route.name === action.payload.name && id === getId?.({ params: route.params })\n );\n }\n\n let params;\n\n if (action.type === 'NAVIGATE' && action.payload.merge && route) {\n params =\n action.payload.params !== undefined ||\n routeParamList[action.payload.name] !== undefined\n ? {\n ...routeParamList[action.payload.name],\n ...route.params,\n ...action.payload.params,\n }\n : route.params;\n } else {\n params =\n routeParamList[action.payload.name] !== undefined\n ? {\n ...routeParamList[action.payload.name],\n ...action.payload.params,\n }\n : action.payload.params;\n }\n\n let routes: Route<string>[];\n\n if (route) {\n if (action.type === 'NAVIGATE' && action.payload.pop) {\n routes = [];\n\n // Get all routes until the matching one\n for (const r of state.routes) {\n if (r.key === route.key) {\n routes.push({\n ...route,\n path: action.payload.path !== undefined ? action.payload.path : route.path,\n params,\n });\n break;\n }\n\n routes.push(r);\n }\n } else {\n // START FORK\n // If there is an id, then filter out the existing route with the same id.\n // THIS ACTION IS DANGEROUS. This can cause React Native Screens to freeze\n if (id !== undefined) {\n routes = state.routes.filter((r) => r.key !== route.key);\n } else if (action.type === 'NAVIGATE' && state.routes.length > 0) {\n // The navigation action should only replace the last route if it has the same name and path params.\n const lastRoute = state.routes[state.routes.length - 1];\n if (\n getSingularId(lastRoute.name, { params: lastRoute.params }) ===\n getSingularId(route.name, { params })\n ) {\n routes = state.routes.slice(0, -1);\n } else {\n routes = [...state.routes];\n }\n } else {\n routes = [...state.routes];\n }\n\n // If the routes length is the same as the state routes length, then we are navigating to a new route.\n // Otherwise we are replacing an existing route.\n const key =\n routes.length === state.routes.length && !isPreviewAction(action)\n ? `${action.payload.name}-${nanoid()}`\n : route.key;\n\n routes.push({\n ...route,\n key,\n path:\n action.type === 'NAVIGATE' && action.payload.path !== undefined\n ? action.payload.path\n : route.path,\n params,\n });\n\n // routes = state.routes.filter((r) => r.key !== route.key);\n // routes.push({\n // ...route,\n // path:\n // action.type === 'NAVIGATE' && action.payload.path !== undefined\n // ? action.payload.path\n // : route.path,\n // params,\n // });\n // END FORK\n }\n } else {\n routes = [\n ...state.routes,\n {\n key: `${action.payload.name}-${nanoid()}`,\n name: action.payload.name,\n path: action.type === 'NAVIGATE' ? action.payload.path : undefined,\n params,\n },\n ];\n }\n\n // START FORK\n // return filterSingular(\n const result = {\n ...state,\n index: routes.length - 1,\n preloadedRoutes: state.preloadedRoutes.filter(\n (route) => routes[routes.length - 1].key !== route.key\n ),\n routes,\n };\n\n if (actionSingularOptions) {\n return filterSingular(result, getId);\n }\n\n return result;\n // return {\n // ...state,\n // index: routes.length - 1,\n // preloadedRoutes: state.preloadedRoutes.filter(\n // (route) => routes[routes.length - 1].key !== route.key\n // ),\n // routes,\n // };\n // END FORK\n }\n case 'PRELOAD': {\n // START FORK\n // This will be the case for example for protected route\n if (!state.routeNames.includes(action.payload.name)) {\n return null;\n }\n // END FORK\n const getId = options.routeGetIdList[action.payload.name];\n const id = getId?.({ params: action.payload.params });\n\n let route: Route<string> | undefined;\n\n if (id !== undefined) {\n route = state.routes.find(\n (route) =>\n route.name === action.payload.name && id === getId?.({ params: route.params })\n );\n }\n\n if (route) {\n return {\n ...state,\n routes: state.routes.map((r) => {\n if (r.key !== route?.key) {\n return r;\n }\n return {\n ...r,\n params:\n routeParamList[action.payload.name] !== undefined\n ? {\n ...routeParamList[action.payload.name],\n ...action.payload.params,\n }\n : action.payload.params,\n };\n }),\n };\n } else {\n // START FORK\n const currentPreloadedRoute: (typeof state)['preloadedRoutes'][number] = {\n key: `${action.payload.name}-${nanoid()}`,\n name: action.payload.name,\n params:\n routeParamList[action.payload.name] !== undefined\n ? {\n ...routeParamList[action.payload.name],\n ...action.payload.params,\n }\n : action.payload.params,\n };\n // END FORK\n return {\n ...state,\n // START FORK\n // Adding the current preloaded route to the beginning of the preloadedRoutes array\n // This ensures that the preloaded route will be the next one after the visible route\n // and when navigation will happen, there will be no reshuffling\n // This is a workaround for the link preview navigation issue, when screen would freeze after navigation from native side\n // and reshuffling from react-navigation\n preloadedRoutes: [currentPreloadedRoute].concat(\n state.preloadedRoutes.filter(\n (r) => r.name !== action.payload.name || id !== getId?.({ params: r.params })\n )\n ),\n // preloadedRoutes: state.preloadedRoutes\n // .filter(\n // (r) =>\n // r.name !== action.payload.name ||\n // id !== getId?.({ params: r.params })\n // )\n // .concat({\n // key: `${action.payload.name}-${nanoid()}`,\n // name: action.payload.name,\n // params:\n // routeParamList[action.payload.name] !== undefined\n // ? {\n // ...routeParamList[action.payload.name],\n // ...action.payload.params,\n // }\n // : action.payload.params,\n // }),\n // END FORK\n };\n }\n }\n default: {\n return original.getStateForAction(state, action, options);\n }\n }\n },\n };\n};\n\nfunction getActionSingularIdFn(\n actionGetId: SingularOptions | undefined,\n name: string\n): GetId | undefined {\n if (typeof actionGetId === 'function') {\n return (options) => actionGetId(name, options.params ?? {});\n } else if (actionGetId === true) {\n return (options) => getSingularId(name, options);\n }\n\n return undefined;\n}\n\n/**\n * If there is a dynamic singular on an action, then we need to filter the state to only have singular screens.\n * As multiples may have been added before we did the singular navigation.\n */\nfunction filterSingular<\n T extends\n | StackNavigationState<ParamListBase>\n | PartialState<StackNavigationState<ParamListBase>>\n | null,\n>(state: T, getId?: GetId): T {\n if (!state) {\n return state;\n }\n\n if (!state.routes) {\n return state;\n }\n\n const currentIndex = state.index || state.routes.length - 1;\n const current = state.routes[currentIndex];\n const name = current.name;\n\n const id = getId?.({ params: current.params });\n\n if (!id) {\n return state;\n }\n\n // TypeScript needs a type assertion here for the filter to work.\n let routes = state.routes as PartialRoute<Route<string, object | undefined>>[];\n routes = routes.filter((route, index) => {\n // If the route is the current route, keep it.\n if (index === currentIndex) {\n return true;\n }\n\n // Remove all other routes with the same name and id.\n return name !== route.name || id !== getId?.({ params: route.params });\n });\n\n return {\n ...state,\n index: routes.length - 1,\n routes,\n };\n}\n\nconst Stack = Object.assign(\n (props: ComponentProps<typeof RNStack>) => {\n const { isStackAnimationDisabled } = useLinkPreviewContext();\n\n const screenOptions = useMemo(() => {\n const condition = isStackAnimationDisabled ? () => true : shouldDisableAnimationBasedOnParams;\n\n return disableAnimationInScreenOptions(props.screenOptions, condition);\n }, [props.screenOptions, isStackAnimationDisabled]);\n\n return (\n <RNStack {...props} screenOptions={screenOptions} UNSTABLE_router={stackRouterOverride} />\n );\n },\n {\n Screen: RNStack.Screen as (\n props: ComponentProps<typeof RNStack.Screen> & { singular?: boolean }\n ) => null,\n Protected,\n }\n);\n\ntype NativeStackScreenOptions = ComponentProps<typeof RNStack>['screenOptions'];\n\nfunction disableAnimationInScreenOptions(\n options: NativeStackScreenOptions | undefined,\n condition: (route: RouteProp<ParamListBase, string>) => boolean\n): NativeStackScreenOptions {\n if (options && typeof options === 'function') {\n return (props) => {\n const oldOptions = options(props);\n if (condition(props.route)) {\n return {\n ...oldOptions,\n animation: 'none',\n };\n }\n return oldOptions ?? {};\n };\n }\n return (props) => {\n if (condition(props.route)) {\n return {\n ...(options ?? {}),\n animation: 'none',\n };\n }\n return options ?? {};\n };\n}\n\nfunction shouldDisableAnimationBasedOnParams(route: RouteProp<ParamListBase, string>): boolean {\n const expoParams = getInternalExpoRouterParams(route.params);\n return !!expoParams.__internal_expo_router_no_animation;\n}\n\nexport default Stack;\n\nexport const StackRouter: typeof RNStackRouter = (options) => {\n const router = RNStackRouter(options);\n return {\n ...router,\n ...stackRouterOverride(router),\n };\n};\n"]}
1
+ {"version":3,"file":"StackClient.js","sourceRoot":"","sources":["../../src/layouts/StackClient.tsx"],"names":[],"mappings":";AAAA,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K,CAAC,MAAM,CAAC,CAAC;IAC7D,OAAO,CAAC,CAAC,UAAU,CAAC,mCAAmC,CAAC;AAC1D,CAAC;AAED,kBAAe,KAAK,CAAC;AAEd,MAAM,WAAW,GAAyB,CAAC,OAAO,EAAE,EAAE;IAC3D,MAAM,MAAM,GAAG,IAAA,oBAAa,EAAC,OAAO,CAAC,CAAC;IACtC,OAAO;QACL,GAAG,MAAM;QACT,GAAG,IAAA,2BAAmB,EAAC,MAAM,CAAC;KAC/B,CAAC;AACJ,CAAC,CAAC;AANW,QAAA,WAAW,eAMtB","sourcesContent":["'use client';\nimport {\n CommonNavigationAction,\n NavigationAction,\n ParamListBase,\n PartialRoute,\n PartialState,\n Route,\n RouterConfigOptions,\n StackRouter as RNStackRouter,\n StackActionType,\n StackNavigationState,\n type RouteProp,\n} from '@react-navigation/native';\nimport {\n NativeStackNavigationEventMap,\n NativeStackNavigationOptions,\n} from '@react-navigation/native-stack';\nimport { nanoid } from 'nanoid/non-secure';\nimport { ComponentProps, useMemo } from 'react';\n\nimport { withLayoutContext } from './withLayoutContext';\nimport { createNativeStackNavigator } from '../fork/native-stack/createNativeStackNavigator';\nimport { useLinkPreviewContext } from '../link/preview/LinkPreviewContext';\nimport { getInternalExpoRouterParams, type InternalExpoRouterParams } from '../navigationParams';\nimport { SingularOptions, getSingularId } from '../useScreens';\nimport { Protected } from '../views/Protected';\n\ntype GetId = NonNullable<RouterConfigOptions['routeGetIdList'][string]>;\n\nconst NativeStackNavigator = createNativeStackNavigator().Navigator;\n\n/**\n * We extend NativeStackNavigationOptions with our custom props\n * to allow for several extra props to be used on web, like modalWidth\n */\nexport type ExtendedStackNavigationOptions = NativeStackNavigationOptions & {\n webModalStyle?: {\n /**\n * Override the width of the modal (px or percentage). Only applies on web platform.\n * @platform web\n */\n width?: number | string;\n /**\n * Override the height of the modal (px or percentage). Applies on web desktop.\n * @platform web\n */\n height?: number | string;\n /**\n * Minimum height of the desktop modal (px or percentage). Overrides the default 640px clamp.\n * @platform web\n */\n minHeight?: number | string;\n /**\n * Minimum width of the desktop modal (px or percentage). Overrides the default 580px.\n * @platform web\n */\n minWidth?: number | string;\n /**\n * Override the border of the desktop modal (any valid CSS border value, e.g. '1px solid #ccc' or 'none').\n * @platform web\n */\n border?: string;\n /**\n * Override the overlay background color (any valid CSS color or rgba/hsla value).\n * @platform web\n */\n overlayBackground?: string;\n /**\n * Override the modal shadow filter (any valid CSS filter value, e.g. 'drop-shadow(0 4px 8px rgba(0,0,0,0.1))' or 'none').\n * @platform web\n */\n shadow?: string;\n };\n};\n\nconst RNStack = withLayoutContext<\n ExtendedStackNavigationOptions,\n typeof NativeStackNavigator,\n StackNavigationState<ParamListBase>,\n NativeStackNavigationEventMap\n>(NativeStackNavigator);\n\ntype RNNavigationAction = Extract<CommonNavigationAction, { type: 'NAVIGATE' }>;\ntype RNPreloadAction = Extract<CommonNavigationAction, { type: 'PRELOAD' }>;\ntype ExpoNavigationAction = Omit<RNNavigationAction, 'payload'> & {\n payload: Omit<RNNavigationAction['payload'], 'params'> & {\n params: RNNavigationAction['payload']['params'] & InternalExpoRouterParams;\n };\n};\n\nfunction isStackAction(\n action: NavigationAction\n): action is StackActionType | RNPreloadAction | ExpoNavigationAction {\n return (\n action.type === 'PUSH' ||\n action.type === 'NAVIGATE' ||\n action.type === 'POP' ||\n action.type === 'POP_TO_TOP' ||\n action.type === 'REPLACE' ||\n action.type === 'PRELOAD'\n );\n}\n\nconst isPreviewAction = (action: NavigationAction): action is ExpoNavigationAction =>\n !!action.payload &&\n 'params' in action.payload &&\n typeof action.payload.params === 'object' &&\n !!getInternalExpoRouterParams(action.payload?.params ?? undefined)[\n '__internal__expo_router_is_preview_navigation'\n ];\n\n/**\n * React Navigation matches a screen by its name or a 'getID' function that uniquely identifies a screen.\n * When a screen has been uniquely identified, the Stack can only have one instance of that screen.\n *\n * Expo Router allows for a screen to be matched by name and path params, a 'getID' function or a singular id.\n *\n * Instead of reimplementing the entire StackRouter, we can override the getStateForAction method to handle the singular screen logic.\n *\n */\nexport const stackRouterOverride: NonNullable<ComponentProps<typeof RNStack>['UNSTABLE_router']> = (\n original\n) => {\n return {\n getStateForAction: (state, action, options) => {\n if (action.target && action.target !== state.key) {\n return null;\n }\n\n if (!isStackAction(action)) {\n return original.getStateForAction(state, action, options);\n }\n\n // The dynamic getId added to an action, `router.push('screen', { singular: true })`\n const actionSingularOptions =\n action.payload && 'singular' in action.payload\n ? (action.payload.singular as SingularOptions)\n : undefined;\n\n // Handle if 'getID' or 'singular' is set.\n function getIdFunction(): GetId | undefined {\n // Actions can be fired by the user, so we do need to validate their structure.\n if (\n !('payload' in action) ||\n !action.payload ||\n !('name' in action.payload) ||\n typeof action.payload.name !== 'string'\n ) {\n return;\n }\n\n const actionName = action.payload.name;\n\n return (\n // The dynamic singular added to an action, `router.push('screen', { singular: () => 'id' })`\n getActionSingularIdFn(actionSingularOptions, actionName) ||\n // The static getId added as a prop to `<Screen singular />` or `<Screen getId={} />`\n options.routeGetIdList[actionName]\n );\n }\n\n const { routeParamList } = options;\n\n switch (action.type) {\n case 'PUSH':\n case 'NAVIGATE': {\n if (!state.routeNames.includes(action.payload.name)) {\n return null;\n }\n\n // START FORK\n const getId = getIdFunction();\n // const getId = options.routeGetIdList[action.payload.name];\n // END FORK\n const id = getId?.({ params: action.payload.params });\n\n let route: Route<string> | undefined;\n\n if (id !== undefined) {\n route = state.routes.findLast(\n (route) =>\n route.name === action.payload.name && id === getId?.({ params: route.params })\n );\n } else if (action.type === 'NAVIGATE') {\n const currentRoute = state.routes[state.index];\n\n // If the route matches the current one, then navigate to it\n if (action.payload.name === currentRoute.name) {\n route = currentRoute;\n } else if (action.payload.pop) {\n route = state.routes.findLast((route) => route.name === action.payload.name);\n }\n }\n\n // START FORK\n if (isPreviewAction(action) && !route) {\n route = state.preloadedRoutes.find(\n (route) => route.name === action.payload.name && id === route.key\n );\n }\n // END FORK\n\n if (!route) {\n route = state.preloadedRoutes.find(\n (route) =>\n route.name === action.payload.name && id === getId?.({ params: route.params })\n );\n }\n\n let params;\n\n if (action.type === 'NAVIGATE' && action.payload.merge && route) {\n params =\n action.payload.params !== undefined ||\n routeParamList[action.payload.name] !== undefined\n ? {\n ...routeParamList[action.payload.name],\n ...route.params,\n ...action.payload.params,\n }\n : route.params;\n } else {\n params =\n routeParamList[action.payload.name] !== undefined\n ? {\n ...routeParamList[action.payload.name],\n ...action.payload.params,\n }\n : action.payload.params;\n }\n\n let routes: Route<string>[];\n\n if (route) {\n if (action.type === 'NAVIGATE' && action.payload.pop) {\n routes = [];\n\n // Get all routes until the matching one\n for (const r of state.routes) {\n if (r.key === route.key) {\n routes.push({\n ...route,\n path: action.payload.path !== undefined ? action.payload.path : route.path,\n params,\n });\n break;\n }\n\n routes.push(r);\n }\n } else {\n // START FORK\n // If there is an id, then filter out the existing route with the same id.\n // THIS ACTION IS DANGEROUS. This can cause React Native Screens to freeze\n if (id !== undefined) {\n routes = state.routes.filter((r) => r.key !== route.key);\n } else if (action.type === 'NAVIGATE' && state.routes.length > 0) {\n // The navigation action should only replace the last route if it has the same name and path params.\n const lastRoute = state.routes[state.routes.length - 1];\n if (\n getSingularId(lastRoute.name, { params: lastRoute.params }) ===\n getSingularId(route.name, { params })\n ) {\n routes = state.routes.slice(0, -1);\n } else {\n routes = [...state.routes];\n }\n } else {\n routes = [...state.routes];\n }\n\n // If the routes length is the same as the state routes length, then we are navigating to a new route.\n // Otherwise we are replacing an existing route.\n const key =\n routes.length === state.routes.length && !isPreviewAction(action)\n ? `${action.payload.name}-${nanoid()}`\n : route.key;\n\n routes.push({\n ...route,\n key,\n path:\n action.type === 'NAVIGATE' && action.payload.path !== undefined\n ? action.payload.path\n : route.path,\n params,\n });\n\n // routes = state.routes.filter((r) => r.key !== route.key);\n // routes.push({\n // ...route,\n // path:\n // action.type === 'NAVIGATE' && action.payload.path !== undefined\n // ? action.payload.path\n // : route.path,\n // params,\n // });\n // END FORK\n }\n } else {\n routes = [\n ...state.routes,\n {\n key: `${action.payload.name}-${nanoid()}`,\n name: action.payload.name,\n path: action.type === 'NAVIGATE' ? action.payload.path : undefined,\n params,\n },\n ];\n }\n\n // START FORK\n // return filterSingular(\n const result = {\n ...state,\n index: routes.length - 1,\n preloadedRoutes: state.preloadedRoutes.filter(\n (route) => routes[routes.length - 1].key !== route.key\n ),\n routes,\n };\n\n if (actionSingularOptions) {\n return filterSingular(result, getId);\n }\n\n return result;\n // return {\n // ...state,\n // index: routes.length - 1,\n // preloadedRoutes: state.preloadedRoutes.filter(\n // (route) => routes[routes.length - 1].key !== route.key\n // ),\n // routes,\n // };\n // END FORK\n }\n case 'PRELOAD': {\n // START FORK\n // This will be the case for example for protected route\n if (!state.routeNames.includes(action.payload.name)) {\n return null;\n }\n // END FORK\n const getId = options.routeGetIdList[action.payload.name];\n const id = getId?.({ params: action.payload.params });\n\n let route: Route<string> | undefined;\n\n if (id !== undefined) {\n route = state.routes.find(\n (route) =>\n route.name === action.payload.name && id === getId?.({ params: route.params })\n );\n }\n\n if (route) {\n return {\n ...state,\n routes: state.routes.map((r) => {\n if (r.key !== route?.key) {\n return r;\n }\n return {\n ...r,\n params:\n routeParamList[action.payload.name] !== undefined\n ? {\n ...routeParamList[action.payload.name],\n ...action.payload.params,\n }\n : action.payload.params,\n };\n }),\n };\n } else {\n // START FORK\n const currentPreloadedRoute: (typeof state)['preloadedRoutes'][number] = {\n key: `${action.payload.name}-${nanoid()}`,\n name: action.payload.name,\n params:\n routeParamList[action.payload.name] !== undefined\n ? {\n ...routeParamList[action.payload.name],\n ...action.payload.params,\n }\n : action.payload.params,\n };\n // END FORK\n return {\n ...state,\n // START FORK\n // Adding the current preloaded route to the beginning of the preloadedRoutes array\n // This ensures that the preloaded route will be the next one after the visible route\n // and when navigation will happen, there will be no reshuffling\n // This is a workaround for the link preview navigation issue, when screen would freeze after navigation from native side\n // and reshuffling from react-navigation\n preloadedRoutes: [currentPreloadedRoute].concat(\n state.preloadedRoutes.filter(\n (r) => r.name !== action.payload.name || id !== getId?.({ params: r.params })\n )\n ),\n // preloadedRoutes: state.preloadedRoutes\n // .filter(\n // (r) =>\n // r.name !== action.payload.name ||\n // id !== getId?.({ params: r.params })\n // )\n // .concat({\n // key: `${action.payload.name}-${nanoid()}`,\n // name: action.payload.name,\n // params:\n // routeParamList[action.payload.name] !== undefined\n // ? {\n // ...routeParamList[action.payload.name],\n // ...action.payload.params,\n // }\n // : action.payload.params,\n // }),\n // END FORK\n };\n }\n }\n default: {\n return original.getStateForAction(state, action, options);\n }\n }\n },\n };\n};\n\nfunction getActionSingularIdFn(\n actionGetId: SingularOptions | undefined,\n name: string\n): GetId | undefined {\n if (typeof actionGetId === 'function') {\n return (options) => actionGetId(name, options.params ?? {});\n } else if (actionGetId === true) {\n return (options) => getSingularId(name, options);\n }\n\n return undefined;\n}\n\n/**\n * If there is a dynamic singular on an action, then we need to filter the state to only have singular screens.\n * As multiples may have been added before we did the singular navigation.\n */\nfunction filterSingular<\n T extends\n | StackNavigationState<ParamListBase>\n | PartialState<StackNavigationState<ParamListBase>>\n | null,\n>(state: T, getId?: GetId): T {\n if (!state) {\n return state;\n }\n\n if (!state.routes) {\n return state;\n }\n\n const currentIndex = state.index || state.routes.length - 1;\n const current = state.routes[currentIndex];\n const name = current.name;\n\n const id = getId?.({ params: current.params });\n\n if (!id) {\n return state;\n }\n\n // TypeScript needs a type assertion here for the filter to work.\n let routes = state.routes as PartialRoute<Route<string, object | undefined>>[];\n routes = routes.filter((route, index) => {\n // If the route is the current route, keep it.\n if (index === currentIndex) {\n return true;\n }\n\n // Remove all other routes with the same name and id.\n return name !== route.name || id !== getId?.({ params: route.params });\n });\n\n return {\n ...state,\n index: routes.length - 1,\n routes,\n };\n}\n\nconst Stack = Object.assign(\n (props: ComponentProps<typeof RNStack>) => {\n const { isStackAnimationDisabled } = useLinkPreviewContext();\n\n const screenOptions = useMemo(() => {\n const condition = isStackAnimationDisabled ? () => true : shouldDisableAnimationBasedOnParams;\n\n return disableAnimationInScreenOptions(props.screenOptions, condition);\n }, [props.screenOptions, isStackAnimationDisabled]);\n\n return (\n <RNStack {...props} screenOptions={screenOptions} UNSTABLE_router={stackRouterOverride} />\n );\n },\n {\n Screen: RNStack.Screen as (\n props: ComponentProps<typeof RNStack.Screen> & { singular?: boolean }\n ) => null,\n Protected,\n }\n);\n\ntype NativeStackScreenOptions = ComponentProps<typeof RNStack>['screenOptions'];\n\nfunction disableAnimationInScreenOptions(\n options: NativeStackScreenOptions | undefined,\n condition: (route: RouteProp<ParamListBase, string>) => boolean\n): NativeStackScreenOptions {\n if (options && typeof options === 'function') {\n return (props) => {\n const oldOptions = options(props);\n if (condition(props.route)) {\n return {\n ...oldOptions,\n animation: 'none',\n };\n }\n return oldOptions ?? {};\n };\n }\n return (props) => {\n if (condition(props.route)) {\n return {\n ...(options ?? {}),\n animation: 'none',\n };\n }\n return options ?? {};\n };\n}\n\nfunction shouldDisableAnimationBasedOnParams(route: RouteProp<ParamListBase, string>): boolean {\n const expoParams = getInternalExpoRouterParams(route.params);\n return !!expoParams.__internal_expo_router_no_animation;\n}\n\nexport default Stack;\n\nexport const StackRouter: typeof RNStackRouter = (options) => {\n const router = RNStackRouter(options);\n return {\n ...router,\n ...stackRouterOverride(router),\n };\n};\n"]}
@@ -102,26 +102,25 @@ function ModalStackRouteDrawer({ routeKey, options, renderScreen, onDismiss, the
102
102
  // dvh is important, otherwise it will scale over the visible viewport height
103
103
  modalStyleVars.maxHeight = '100dvh';
104
104
  }
105
- // Apply corner radius (default 10px)
106
- const radiusValue = options.sheetCornerRadius ?? 10;
105
+ // Apply corner radius (default 24px for iOS 26)
106
+ const radiusValue = options.sheetCornerRadius ?? 24;
107
107
  const radiusCss = typeof radiusValue === 'number' ? `${radiusValue}px` : radiusValue;
108
108
  if (options.webModalStyle?.border) {
109
109
  modalStyleVars['--expo-router-modal-border'] = options.webModalStyle.border;
110
110
  }
111
+ if (options.webModalStyle?.shadow) {
112
+ modalStyleVars['--expo-router-modal-shadow'] = options.webModalStyle.shadow;
113
+ }
111
114
  if (isSheet) {
112
115
  // Only top corners for mobile sheet
113
116
  modalStyleVars.borderTopLeftRadius = radiusCss;
114
117
  modalStyleVars.borderTopRightRadius = radiusCss;
115
- // Only apply CSS var override if a custom corner radius was provided
116
- if (options.sheetCornerRadius) {
117
- modalStyleVars['--expo-router-modal-border-radius'] = radiusCss;
118
- }
118
+ // Always set CSS var to ensure consistency with default iOS 26 radius
119
+ modalStyleVars['--expo-router-modal-border-radius'] = radiusCss;
119
120
  }
120
121
  else {
121
- // All corners for desktop modal
122
- if (options.sheetCornerRadius) {
123
- modalStyleVars['--expo-router-modal-border-radius'] = radiusCss;
124
- }
122
+ // All corners for desktop modal - always set CSS var for iOS 26 default
123
+ modalStyleVars['--expo-router-modal-border-radius'] = radiusCss;
125
124
  }
126
125
  // --- End Styling -----------------------------------------------------------
127
126
  const handleOpenChange = (open) => {
@@ -1 +1 @@
1
- {"version":3,"file":"ModalStackRouteDrawer.js","sourceRoot":"","sources":["../../../src/modal/web/ModalStackRouteDrawer.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;;AA6NJ,sDAAqB;AA5N9B,kDAA0B;AAC1B,+BAA8B;AAE9B,gEAAwC;AAExC,mCAAuC;AAGvC,SAAS,qBAAqB,CAAC,EAC7B,QAAQ,EACR,OAAO,EACP,YAAY,EACZ,SAAS,EACT,WAAW,GAOZ;IACC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,eAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC7C,4EAA4E;IAC5E,wEAAwE;IACxE,wEAAwE;IACxE,MAAM,SAAS,GAAG,IAAA,oBAAY,GAAE,CAAC;IACjC,MAAM,OAAO,GAAG,CAAC,SAAS,CAAC;IAE3B,6BAA6B;IAC7B,MAAM,OAAO,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAE5C,MAAM,cAAc,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAC9C,MAAM,mBA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E,aAAM,CAAC,OAAO,CAClB;MAAA,EAAE,aAAM,CAAC,MAAM,CACjB;IAAA,EAAE,aAAM,CAAC,IAAI,CAAC,CACf,CAAC;AACJ,CAAC","sourcesContent":["'use client';\nimport React from 'react';\nimport { Drawer } from 'vaul';\n\nimport modalStyles from './modalStyles';\nimport { CSSWithVars } from './types';\nimport { useIsDesktop } from './utils';\nimport { ExtendedStackNavigationOptions } from '../../layouts/StackClient';\n\nfunction ModalStackRouteDrawer({\n routeKey,\n options,\n renderScreen,\n onDismiss,\n themeColors,\n}: {\n routeKey: string;\n options: ExtendedStackNavigationOptions;\n renderScreen: () => React.ReactNode;\n onDismiss: () => void;\n themeColors: { card: string; background: string };\n}) {\n const [open, setOpen] = React.useState(true);\n // Determine sheet vs. modal with an SSR-safe hook. The first render (during\n // hydration) always assumes mobile/sheet to match the server markup; an\n // effect then updates the state after mount if the viewport is desktop.\n const isDesktop = useIsDesktop();\n const isSheet = !isDesktop;\n\n // Resolve snap points logic.\n const allowed = options.sheetAllowedDetents;\n\n const isArrayDetents = Array.isArray(allowed);\n const useCustomSnapPoints = isArrayDetents && !(allowed.length === 1 && allowed[0] === 1);\n\n let snapPoints: (number | string)[] | undefined = useCustomSnapPoints\n ? (allowed as (number | string)[])\n : undefined;\n\n if (!isSheet) {\n snapPoints = [1];\n }\n\n const [snap, setSnap] = React.useState<number | string | null>(\n useCustomSnapPoints && isArrayDetents ? allowed[0] : 1\n );\n\n // Update the snap value when custom snap points change.\n React.useEffect(() => {\n if (isSheet) {\n const next = useCustomSnapPoints && isArrayDetents ? allowed[0] : 1;\n setSnap(next);\n } else {\n // Desktop modal always fixed snap at 1\n setSnap(1);\n }\n }, [isSheet, useCustomSnapPoints, isArrayDetents, allowed]);\n\n // Map react-native-screens ios sheet undimmed logic to Vaul's fadeFromIndex\n const fadeFromIndex = isSheet\n ? options.sheetLargestUndimmedDetentIndex === 'last'\n ? (snapPoints?.length ?? 0)\n : typeof options.sheetLargestUndimmedDetentIndex === 'number'\n ? options.sheetLargestUndimmedDetentIndex + 1\n : 0\n : 0;\n\n // --- Styling -----------------------------------------------------------\n\n // Using CSS variables so defaults live in CSS and can be overridden via props.\n const modalStyleVars: CSSWithVars = {\n backgroundColor: themeColors.background,\n };\n\n if (!isSheet) {\n if (options.webModalStyle?.width) {\n modalStyleVars['--expo-router-modal-width'] =\n typeof options.webModalStyle.width === 'number'\n ? `${options.webModalStyle.width}px`\n : options.webModalStyle.width;\n\n modalStyleVars['--expo-router-modal-max-width'] =\n typeof options.webModalStyle.width === 'number'\n ? `${options.webModalStyle.width}px`\n : options.webModalStyle.width;\n\n // Also set explicit width so browsers that ignore CSS vars in `width` prop still work.\n modalStyleVars.width =\n typeof options.webModalStyle.width === 'number'\n ? `${options.webModalStyle.width}px`\n : options.webModalStyle.width;\n }\n\n // Min width override\n if (options.webModalStyle?.minWidth) {\n const mw =\n typeof options.webModalStyle.minWidth === 'number'\n ? `${options.webModalStyle.minWidth}px`\n : options.webModalStyle.minWidth;\n modalStyleVars['--expo-router-modal-min-width'] = mw;\n modalStyleVars.minWidth = mw;\n }\n\n if (options.webModalStyle?.height) {\n const h =\n typeof options.webModalStyle.height === 'number'\n ? `${options.webModalStyle.height}px`\n : options.webModalStyle.height;\n modalStyleVars['--expo-router-modal-height'] = h;\n modalStyleVars.maxHeight = h;\n modalStyleVars.height = h;\n modalStyleVars.minHeight = h;\n }\n\n // Separate min-height override (takes precedence over modalHeight)\n if (options.webModalStyle?.minHeight) {\n const mh =\n typeof options.webModalStyle.minHeight === 'number'\n ? `${options.webModalStyle.minHeight}px`\n : options.webModalStyle.minHeight;\n modalStyleVars['--expo-router-modal-min-height'] = mh;\n modalStyleVars.minHeight = mh;\n }\n }\n\n const fitToContents = options.sheetAllowedDetents === 'fitToContents';\n\n if (fitToContents) {\n modalStyleVars.height = 'auto';\n modalStyleVars.minHeight = 'auto';\n\n // TODO:(@Hirbod) Clarify if we should limit maxHeight to sheets only\n // Allow sheet to grow with content but never exceed viewport height\n // dvh is important, otherwise it will scale over the visible viewport height\n modalStyleVars.maxHeight = '100dvh';\n }\n\n // Apply corner radius (default 10px)\n const radiusValue = options.sheetCornerRadius ?? 10;\n const radiusCss = typeof radiusValue === 'number' ? `${radiusValue}px` : radiusValue;\n\n if (options.webModalStyle?.border) {\n modalStyleVars['--expo-router-modal-border'] = options.webModalStyle.border;\n }\n\n if (isSheet) {\n // Only top corners for mobile sheet\n modalStyleVars.borderTopLeftRadius = radiusCss;\n modalStyleVars.borderTopRightRadius = radiusCss;\n\n // Only apply CSS var override if a custom corner radius was provided\n if (options.sheetCornerRadius) {\n modalStyleVars['--expo-router-modal-border-radius'] = radiusCss;\n }\n } else {\n // All corners for desktop modal\n if (options.sheetCornerRadius) {\n modalStyleVars['--expo-router-modal-border-radius'] = radiusCss;\n }\n }\n // --- End Styling -----------------------------------------------------------\n\n const handleOpenChange = (open: boolean) => {\n if (!open) onDismiss();\n };\n\n // Props that only make sense for sheets\n const sheetProps = isSheet\n ? {\n snapPoints: snapPoints as (number | string)[],\n activeSnapPoint: snap,\n setActiveSnapPoint: setSnap,\n fadeFromIndex,\n }\n : {};\n\n return (\n <Drawer.Root\n key={`${routeKey}-${isSheet ? 'sheet' : 'modal'}`}\n open={open}\n dismissible={options.gestureEnabled ?? true}\n onAnimationEnd={handleOpenChange}\n shouldScaleBackground\n autoFocus\n onOpenChange={setOpen}\n {...sheetProps}>\n <Drawer.Portal>\n <Drawer.Overlay\n className={modalStyles.overlay}\n style={\n options.webModalStyle?.overlayBackground\n ? ({\n '--expo-router-modal-overlay-background': options.webModalStyle.overlayBackground,\n } as React.CSSProperties)\n : undefined\n }\n />\n <Drawer.Content\n aria-describedby=\"modal-description\"\n className={modalStyles.drawerContent}\n style={{\n pointerEvents: 'none',\n // This needs to be limited to sheets, otherwise it will position the modal at the bottom of the screen\n ...(isSheet && fitToContents ? { height: 'auto' } : null),\n }}>\n <div\n className={modalStyles.modal}\n data-presentation={isSheet ? 'formSheet' : 'modal'}\n style={modalStyleVars}>\n {/* TODO:(@Hirbod) Figure out how to add title and description to the modal for screen readers in a meaningful way */}\n <Drawer.Title about=\"\" aria-describedby=\"\" className={modalStyles.srOnly} />\n <Drawer.Description about=\"\" className={modalStyles.srOnly} />\n {/* Render the screen content */}\n <div className={modalStyles.modalBody}>{renderScreen()}</div>\n </div>\n </Drawer.Content>\n </Drawer.Portal>\n </Drawer.Root>\n );\n}\n\nexport { ModalStackRouteDrawer };\n"]}
1
+ {"version":3,"file":"ModalStackRouteDrawer.js","sourceRoot":"","sources":["../../../src/modal/web/ModalStackRouteDrawer.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;;AA6NJ,sDAAqB;AA5N9B,kDAA0B;AAC1B,+BAA8B;AAE9B,gEAAwC;AAExC,mCAAuC;AAGvC,SAAS,qBAAqB,CAAC,EAC7B,QAAQ,EACR,OAAO,EACP,YAAY,EACZ,SAAS,EACT,WAAW,GAOZ;IACC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,eAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC7C,4EAA4E;IAC5E,wEAAwE;IACxE,wEAAwE;IACxE,MAAM,SAAS,GAAG,IAAA,oBAAY,GAAE,CAAC;IACjC,MAAM,OAAO,GAAG,CAAC,SAAS,CAAC;IAE3B,6BAA6B;IAC7B,MAAM,OAAO,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAE5C,MAAM,cAAc,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAC9C,MAAM,mBAAmB,GAAG,cAAc,IAAI,CAAC,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;IAE1F,IAAI,UAAU,GAAoC,mBAAmB;QACnE,CAAC,CAAE,OAA+B;QAClC,CAAC,CAAC,SAAS,CAAC;IAEd,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,UAAU,GAAG,CAAC,CA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aAC1D;YAC3B,CAAC,CAAC,SACN,CAAC,EAEH;QAAA,CAAC,aAAM,CAAC,OAAO,CACb,gBAAgB,CAAC,mBAAmB,CACpC,SAAS,CAAC,CAAC,qBAAW,CAAC,aAAa,CAAC,CACrC,KAAK,CAAC,CAAC;YACL,aAAa,EAAE,MAAM;YACrB,uGAAuG;YACvG,GAAG,CAAC,OAAO,IAAI,aAAa,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;SAC1D,CAAC,CACF;UAAA,CAAC,GAAG,CACF,SAAS,CAAC,CAAC,qBAAW,CAAC,KAAK,CAAC,CAC7B,iBAAiB,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,CACnD,KAAK,CAAC,CAAC,cAAc,CAAC,CACtB;YAAA,CAAC,oHAAoH,CACrH;YAAA,CAAC,aAAM,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,qBAAW,CAAC,MAAM,CAAC,EACzE;YAAA,CAAC,aAAM,CAAC,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,qBAAW,CAAC,MAAM,CAAC,EAC3D;YAAA,CAAC,+BAA+B,CAChC;YAAA,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,qBAAW,CAAC,SAAS,CAAC,CAAC,CAAC,YAAY,EAAE,CAAC,EAAE,GAAG,CAC9D;UAAA,EAAE,GAAG,CACP;QAAA,EAAE,aAAM,CAAC,OAAO,CAClB;MAAA,EAAE,aAAM,CAAC,MAAM,CACjB;IAAA,EAAE,aAAM,CAAC,IAAI,CAAC,CACf,CAAC;AACJ,CAAC","sourcesContent":["'use client';\nimport React from 'react';\nimport { Drawer } from 'vaul';\n\nimport modalStyles from './modalStyles';\nimport { CSSWithVars } from './types';\nimport { useIsDesktop } from './utils';\nimport { ExtendedStackNavigationOptions } from '../../layouts/StackClient';\n\nfunction ModalStackRouteDrawer({\n routeKey,\n options,\n renderScreen,\n onDismiss,\n themeColors,\n}: {\n routeKey: string;\n options: ExtendedStackNavigationOptions;\n renderScreen: () => React.ReactNode;\n onDismiss: () => void;\n themeColors: { card: string; background: string };\n}) {\n const [open, setOpen] = React.useState(true);\n // Determine sheet vs. modal with an SSR-safe hook. The first render (during\n // hydration) always assumes mobile/sheet to match the server markup; an\n // effect then updates the state after mount if the viewport is desktop.\n const isDesktop = useIsDesktop();\n const isSheet = !isDesktop;\n\n // Resolve snap points logic.\n const allowed = options.sheetAllowedDetents;\n\n const isArrayDetents = Array.isArray(allowed);\n const useCustomSnapPoints = isArrayDetents && !(allowed.length === 1 && allowed[0] === 1);\n\n let snapPoints: (number | string)[] | undefined = useCustomSnapPoints\n ? (allowed as (number | string)[])\n : undefined;\n\n if (!isSheet) {\n snapPoints = [1];\n }\n\n const [snap, setSnap] = React.useState<number | string | null>(\n useCustomSnapPoints && isArrayDetents ? allowed[0] : 1\n );\n\n // Update the snap value when custom snap points change.\n React.useEffect(() => {\n if (isSheet) {\n const next = useCustomSnapPoints && isArrayDetents ? allowed[0] : 1;\n setSnap(next);\n } else {\n // Desktop modal always fixed snap at 1\n setSnap(1);\n }\n }, [isSheet, useCustomSnapPoints, isArrayDetents, allowed]);\n\n // Map react-native-screens ios sheet undimmed logic to Vaul's fadeFromIndex\n const fadeFromIndex = isSheet\n ? options.sheetLargestUndimmedDetentIndex === 'last'\n ? (snapPoints?.length ?? 0)\n : typeof options.sheetLargestUndimmedDetentIndex === 'number'\n ? options.sheetLargestUndimmedDetentIndex + 1\n : 0\n : 0;\n\n // --- Styling -----------------------------------------------------------\n\n // Using CSS variables so defaults live in CSS and can be overridden via props.\n const modalStyleVars: CSSWithVars = {\n backgroundColor: themeColors.background,\n };\n\n if (!isSheet) {\n if (options.webModalStyle?.width) {\n modalStyleVars['--expo-router-modal-width'] =\n typeof options.webModalStyle.width === 'number'\n ? `${options.webModalStyle.width}px`\n : options.webModalStyle.width;\n\n modalStyleVars['--expo-router-modal-max-width'] =\n typeof options.webModalStyle.width === 'number'\n ? `${options.webModalStyle.width}px`\n : options.webModalStyle.width;\n\n // Also set explicit width so browsers that ignore CSS vars in `width` prop still work.\n modalStyleVars.width =\n typeof options.webModalStyle.width === 'number'\n ? `${options.webModalStyle.width}px`\n : options.webModalStyle.width;\n }\n\n // Min width override\n if (options.webModalStyle?.minWidth) {\n const mw =\n typeof options.webModalStyle.minWidth === 'number'\n ? `${options.webModalStyle.minWidth}px`\n : options.webModalStyle.minWidth;\n modalStyleVars['--expo-router-modal-min-width'] = mw;\n modalStyleVars.minWidth = mw;\n }\n\n if (options.webModalStyle?.height) {\n const h =\n typeof options.webModalStyle.height === 'number'\n ? `${options.webModalStyle.height}px`\n : options.webModalStyle.height;\n modalStyleVars['--expo-router-modal-height'] = h;\n modalStyleVars.maxHeight = h;\n modalStyleVars.height = h;\n modalStyleVars.minHeight = h;\n }\n\n // Separate min-height override (takes precedence over modalHeight)\n if (options.webModalStyle?.minHeight) {\n const mh =\n typeof options.webModalStyle.minHeight === 'number'\n ? `${options.webModalStyle.minHeight}px`\n : options.webModalStyle.minHeight;\n modalStyleVars['--expo-router-modal-min-height'] = mh;\n modalStyleVars.minHeight = mh;\n }\n }\n\n const fitToContents = options.sheetAllowedDetents === 'fitToContents';\n\n if (fitToContents) {\n modalStyleVars.height = 'auto';\n modalStyleVars.minHeight = 'auto';\n\n // TODO:(@Hirbod) Clarify if we should limit maxHeight to sheets only\n // Allow sheet to grow with content but never exceed viewport height\n // dvh is important, otherwise it will scale over the visible viewport height\n modalStyleVars.maxHeight = '100dvh';\n }\n\n // Apply corner radius (default 24px for iOS 26)\n const radiusValue = options.sheetCornerRadius ?? 24;\n const radiusCss = typeof radiusValue === 'number' ? `${radiusValue}px` : radiusValue;\n\n if (options.webModalStyle?.border) {\n modalStyleVars['--expo-router-modal-border'] = options.webModalStyle.border;\n }\n\n if (options.webModalStyle?.shadow) {\n modalStyleVars['--expo-router-modal-shadow'] = options.webModalStyle.shadow;\n }\n\n if (isSheet) {\n // Only top corners for mobile sheet\n modalStyleVars.borderTopLeftRadius = radiusCss;\n modalStyleVars.borderTopRightRadius = radiusCss;\n\n // Always set CSS var to ensure consistency with default iOS 26 radius\n modalStyleVars['--expo-router-modal-border-radius'] = radiusCss;\n } else {\n // All corners for desktop modal - always set CSS var for iOS 26 default\n modalStyleVars['--expo-router-modal-border-radius'] = radiusCss;\n }\n // --- End Styling -----------------------------------------------------------\n\n const handleOpenChange = (open: boolean) => {\n if (!open) onDismiss();\n };\n\n // Props that only make sense for sheets\n const sheetProps = isSheet\n ? {\n snapPoints: snapPoints as (number | string)[],\n activeSnapPoint: snap,\n setActiveSnapPoint: setSnap,\n fadeFromIndex,\n }\n : {};\n\n return (\n <Drawer.Root\n key={`${routeKey}-${isSheet ? 'sheet' : 'modal'}`}\n open={open}\n dismissible={options.gestureEnabled ?? true}\n onAnimationEnd={handleOpenChange}\n shouldScaleBackground\n autoFocus\n onOpenChange={setOpen}\n {...sheetProps}>\n <Drawer.Portal>\n <Drawer.Overlay\n className={modalStyles.overlay}\n style={\n options.webModalStyle?.overlayBackground\n ? ({\n '--expo-router-modal-overlay-background': options.webModalStyle.overlayBackground,\n } as React.CSSProperties)\n : undefined\n }\n />\n <Drawer.Content\n aria-describedby=\"modal-description\"\n className={modalStyles.drawerContent}\n style={{\n pointerEvents: 'none',\n // This needs to be limited to sheets, otherwise it will position the modal at the bottom of the screen\n ...(isSheet && fitToContents ? { height: 'auto' } : null),\n }}>\n <div\n className={modalStyles.modal}\n data-presentation={isSheet ? 'formSheet' : 'modal'}\n style={modalStyleVars}>\n {/* TODO:(@Hirbod) Figure out how to add title and description to the modal for screen readers in a meaningful way */}\n <Drawer.Title about=\"\" aria-describedby=\"\" className={modalStyles.srOnly} />\n <Drawer.Description about=\"\" className={modalStyles.srOnly} />\n {/* Render the screen content */}\n <div className={modalStyles.modalBody}>{renderScreen()}</div>\n </div>\n </Drawer.Content>\n </Drawer.Portal>\n </Drawer.Root>\n );\n}\n\nexport { ModalStackRouteDrawer };\n"]}
@@ -36,8 +36,9 @@ import type { ExtendedNativeTabOptions, NativeTabTriggerProps } from './types';
36
36
  * </View>
37
37
  * );
38
38
  * }
39
+ * ```
39
40
  *
40
- * **Note:** You can use the alias `NativeTabs.Trigger` for this component.
41
+ * > **Note:** You can use the alias `NativeTabs.Trigger` for this component.
41
42
  */
42
43
  export declare function NativeTabTrigger(props: NativeTabTriggerProps): null;
43
44
  export declare function convertTabPropsToOptions({ options, hidden, children, disablePopToTop, disableScrollToTop, }: NativeTabTriggerProps): ExtendedNativeTabOptions;
@@ -1 +1 @@
1
- {"version":3,"file":"NativeTabTrigger.d.ts","sourceRoot":"","sources":["../../../src/native-tabs/NativeBottomTabs/NativeTabTrigger.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAkB,KAAK,YAAY,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAE1E,OAAO,KAAK,EAAE,wBAAwB,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAK/E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,QAqB5D;AAED,wBAAgB,wBAAwB,CAAC,EACvC,OAAO,EACP,MAAM,EACN,QAAQ,EACR,eAAe,EACf,kBAAkB,GACnB,EAAE,qBAAqB,4BAgEvB;AAED,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,SAAS,EAChB,UAAU,CAAC,EAAE,MAAM,GAClB,KAAK,IAAI,YAAY,CAAC,qBAAqB,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CA6BjE"}
1
+ {"version":3,"file":"NativeTabTrigger.d.ts","sourceRoot":"","sources":["../../../src/native-tabs/NativeBottomTabs/NativeTabTrigger.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAkB,KAAK,YAAY,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAE1E,OAAO,KAAK,EAAE,wBAAwB,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAK/E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,QAqB5D;AAED,wBAAgB,wBAAwB,CAAC,EACvC,OAAO,EACP,MAAM,EACN,QAAQ,EACR,eAAe,EACf,kBAAkB,GACnB,EAAE,qBAAqB,4BAgEvB;AAED,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,SAAS,EAChB,UAAU,CAAC,EAAE,MAAM,GAClB,KAAK,IAAI,YAAY,CAAC,qBAAqB,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CA6BjE"}
@@ -45,8 +45,9 @@ const elements_1 = require("../common/elements");
45
45
  * </View>
46
46
  * );
47
47
  * }
48
+ * ```
48
49
  *
49
- * **Note:** You can use the alias `NativeTabs.Trigger` for this component.
50
+ * > **Note:** You can use the alias `NativeTabs.Trigger` for this component.
50
51
  */
51
52
  function NativeTabTrigger(props) {
52
53
  const route = (0, native_1.useRoute)();
@@ -1 +1 @@
1
- {"version":3,"file":"NativeTabTrigger.js","sourceRoot":"","sources":["../../../src/native-tabs/NativeBottomTabs/NativeTabTrigger.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;AAiDb,4CAqBC;AAED,4DAsEC;AAED,gDAgCC;AA9KD,qDAAmE;AACnE,iCAA0E;AAG1E,mCAAuE;AACvE,yEAAsE;AACtE,iDAAwD;AAExD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,SAAgB,gBAAgB,CAAC,KAA4B;IAC3D,MAAM,KAAK,GAAG,IAAA,iBAAQ,GAAE,CAAC;IACzB,MAAM,UAAU,GAAG,IAAA,sBAAa,GAAE,CAAC;IACnC,MAAM,SAAS,GAAG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,CACb,uDAAuD,UAAU,0GAA0G,CAC5K,CAAC;YACJ,CAAC;QACH,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["'use client';\n\nimport { useNavigation, useRoute } from '@react-navigation/native';\nimport { isValidElement, type ReactElement, type ReactNode } from 'react';\n\nimport type { ExtendedNativeTabOptions, NativeTabTriggerProps } from './types';\nimport { filterAllowedChildrenElements, isChildOfType } from './utils';\nimport { useSafeLayoutEffect } from '../../views/useSafeLayoutEffect';\nimport { Icon, Badge, Label } from '../common/elements';\n\n/**\n * The component used to customize the native tab options both in the _layout file and from the tab screen.\n *\n * When used in the _layout file, you need to provide a `name` prop.\n * When used in the tab screen, the `name` prop takes no effect.\n *\n * @example\n * ```tsx\n * // In _layout file\n * import { NativeTabs } from 'expo-router/unstable-native-tabs';\n *\n * export default function Layout() {\n * return (\n * <NativeTabs>\n * <NativeTabs.Trigger name=\"home\" />\n * <NativeTabs.Trigger name=\"settings\" />\n * </NativeTabs>\n * );\n * }\n * ```\n *\n * @example\n * ```tsx\n * // In a tab screen\n * import { NativeTabs } from 'expo-router/unstable-native-tabs';\n *\n * export default function HomeScreen() {\n * return (\n * <View>\n * <NativeTabs.Trigger>\n * <Label>Home</Label>\n * </NativeTabs.Trigger>\n * <Text>This is home screen!</Text>\n * </View>\n * );\n * }\n *\n * **Note:** You can use the alias `NativeTabs.Trigger` for this component.\n */\nexport function NativeTabTrigger(props: NativeTabTriggerProps) {\n const route = useRoute();\n const navigation = useNavigation();\n const isFocused = navigation.isFocused();\n\n useSafeLayoutEffect(() => {\n // This will cause the tab to update only when it is focused.\n // As long as all tabs are loaded at the start, we don't need this check.\n // It is here to ensure similar behavior to stack\n if (isFocused) {\n if (navigation.getState()?.type !== 'tab') {\n throw new Error(\n `Trigger component can only be used in the tab screen. Current route: ${route.name}`\n );\n }\n const options = convertTabPropsToOptions(props);\n navigation.setOptions(options);\n }\n }, [isFocused, props]);\n\n return null;\n}\n\nexport function convertTabPropsToOptions({\n options,\n hidden,\n children,\n disablePopToTop,\n disableScrollToTop,\n}: NativeTabTriggerProps) {\n const initialOptions: ExtendedNativeTabOptions = {\n ...options,\n hidden: !!hidden,\n specialEffects: {\n repeatedTabSelection: {\n popToRoot: !disablePopToTop,\n scrollToTop: !disableScrollToTop,\n },\n },\n };\n const allowedChildren = filterAllowedChildrenElements(children, [Badge, Label, Icon]);\n return allowedChildren.reduce<ExtendedNativeTabOptions>(\n (acc, child) => {\n if (isChildOfType(child, Badge)) {\n if (child.props.children) {\n acc.badgeValue = String(child.props.children);\n } else if (!child.props.hidden) {\n // If no value is provided, we set it to a space to show the badge\n // Otherwise, the `react-native-screens` will interpret it as a hidden badge\n // https://github.com/software-mansion/react-native-screens/blob/b4358fd95dd0736fc54df6bb97f210dc89edf24c/ios/bottom-tabs/RNSBottomTabsScreenComponentView.mm#L172\n acc.badgeValue = ' ';\n }\n } else if (isChildOfType(child, Label)) {\n if (child.props.hidden) {\n acc.title = '';\n } else {\n acc.title = child.props.children;\n }\n } else if (isChildOfType(child, Icon)) {\n if ('src' in child.props || 'selectedSrc' in child.props) {\n acc.icon = child.props.src\n ? {\n src: child.props.src,\n }\n : undefined;\n acc.selectedIcon = child.props.selectedSrc\n ? {\n src: child.props.selectedSrc,\n }\n : undefined;\n } else if ('sf' in child.props || 'selectedSf' in child.props) {\n if (process.env.EXPO_OS === 'ios') {\n acc.icon = child.props.sf\n ? {\n sf: child.props.sf,\n }\n : undefined;\n acc.selectedIcon = child.props.selectedSf\n ? {\n sf: child.props.selectedSf,\n }\n : undefined;\n }\n }\n if (process.env.EXPO_OS === 'android') {\n acc.icon = { drawable: child.props.drawable };\n acc.selectedIcon = undefined;\n }\n }\n return acc;\n },\n { ...initialOptions }\n );\n}\n\nexport function isNativeTabTrigger(\n child: ReactNode,\n contextKey?: string\n): child is ReactElement<NativeTabTriggerProps & { name: string }> {\n if (isValidElement(child) && child && child.type === NativeTabTrigger) {\n if (\n typeof child.props === 'object' &&\n child.props &&\n 'name' in child.props &&\n !child.props.name\n ) {\n throw new Error(\n `<Trigger /> component in \\`default export\\` at \\`app${contextKey}/_layout\\` must have a \\`name\\` prop when used as a child of a Layout Route.`\n );\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if (\n ['component', 'getComponent'].some(\n (key) => child.props && typeof child.props === 'object' && key in child.props\n )\n ) {\n throw new Error(\n `<Trigger /> component in \\`default export\\` at \\`app${contextKey}/_layout\\` must not have a \\`component\\` or \\`getComponent\\` prop when used as a child of a Layout Route`\n );\n }\n }\n\n return true;\n }\n\n return false;\n}\n"]}
1
+ {"version":3,"file":"NativeTabTrigger.js","sourceRoot":"","sources":["../../../src/native-tabs/NativeBottomTabs/NativeTabTrigger.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;AAkDb,4CAqBC;AAED,4DAsEC;AAED,gDAgCC;AA/KD,qDAAmE;AACnE,iCAA0E;AAG1E,mCAAuE;AACvE,yEAAsE;AACtE,iDAAwD;AAExD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,SAAgB,gBAAgB,CAAC,KAA4B;IAC3D,MAAM,KAAK,GAAG,IAAA,iBAAQ,GAAE,CAAC;IACzB,MAAM,UAAU,GAAG,IAAA,sBAAa,GAAE,CAAC;IACnC,MAAM,SAAS,GAAG,UAAU,CAAC,SAAS,EAAE,CAAC;IAEzC,IAAA,yCAAmB,EAAC,GAAG,EAAE;QACvB,6DAA6D;QAC7D,yEAAyE;QACzE,iDAAiD;QACjD,IAAI,SAAS,EAAE,CAAC;YACd,IAAI,UAAU,CAAC,QAAQ,EAAE,EAAE,IAAI,KAAK,KAAK,EAAE,CAAC;gBAC1C,MAAM,IAAI,KAAK,CACb,wEAAwE,KAAK,CAAC,IAAI,EAAE,CACrF,CAAC;YACJ,CAAC;YACD,MAAM,OAAO,GAAG,wBAAwB,CAAC,KAAK,CAAC,CAAC;YAChD,UAAU,CAAC,UAAU,C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AC;gBAC9C,GAAG,CAAC,YAAY,GAAG,SAAS,CAAC;YAC/B,CAAC;QACH,CAAC;QACD,OAAO,GAAG,CAAC;IACb,CAAC,EACD,EAAE,GAAG,cAAc,EAAE,CACtB,CAAC;AACJ,CAAC;AAED,SAAgB,kBAAkB,CAChC,KAAgB,EAChB,UAAmB;IAEnB,IAAI,IAAA,sBAAc,EAAC,KAAK,CAAC,IAAI,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,gBAAgB,EAAE,CAAC;QACtE,IACE,OAAO,KAAK,CAAC,KAAK,KAAK,QAAQ;YAC/B,KAAK,CAAC,KAAK;YACX,MAAM,IAAI,KAAK,CAAC,KAAK;YACrB,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,EACjB,CAAC;YACD,MAAM,IAAI,KAAK,CACb,uDAAuD,UAAU,8EAA8E,CAChJ,CAAC;QACJ,CAAC;QAED,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,EAAE,CAAC;YAC1C,IACE,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC,IAAI,CAChC,CAAC,GAAG,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,IAAI,OAAO,KAAK,CAAC,KAAK,KAAK,QAAQ,IAAI,GAAG,IAAI,KAAK,CAAC,KAAK,CAC9E,EACD,CAAC;gBACD,MAAM,IAAI,KAAK,CACb,uDAAuD,UAAU,0GAA0G,CAC5K,CAAC;YACJ,CAAC;QACH,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["'use client';\n\nimport { useNavigation, useRoute } from '@react-navigation/native';\nimport { isValidElement, type ReactElement, type ReactNode } from 'react';\n\nimport type { ExtendedNativeTabOptions, NativeTabTriggerProps } from './types';\nimport { filterAllowedChildrenElements, isChildOfType } from './utils';\nimport { useSafeLayoutEffect } from '../../views/useSafeLayoutEffect';\nimport { Icon, Badge, Label } from '../common/elements';\n\n/**\n * The component used to customize the native tab options both in the _layout file and from the tab screen.\n *\n * When used in the _layout file, you need to provide a `name` prop.\n * When used in the tab screen, the `name` prop takes no effect.\n *\n * @example\n * ```tsx\n * // In _layout file\n * import { NativeTabs } from 'expo-router/unstable-native-tabs';\n *\n * export default function Layout() {\n * return (\n * <NativeTabs>\n * <NativeTabs.Trigger name=\"home\" />\n * <NativeTabs.Trigger name=\"settings\" />\n * </NativeTabs>\n * );\n * }\n * ```\n *\n * @example\n * ```tsx\n * // In a tab screen\n * import { NativeTabs } from 'expo-router/unstable-native-tabs';\n *\n * export default function HomeScreen() {\n * return (\n * <View>\n * <NativeTabs.Trigger>\n * <Label>Home</Label>\n * </NativeTabs.Trigger>\n * <Text>This is home screen!</Text>\n * </View>\n * );\n * }\n * ```\n *\n * > **Note:** You can use the alias `NativeTabs.Trigger` for this component.\n */\nexport function NativeTabTrigger(props: NativeTabTriggerProps) {\n const route = useRoute();\n const navigation = useNavigation();\n const isFocused = navigation.isFocused();\n\n useSafeLayoutEffect(() => {\n // This will cause the tab to update only when it is focused.\n // As long as all tabs are loaded at the start, we don't need this check.\n // It is here to ensure similar behavior to stack\n if (isFocused) {\n if (navigation.getState()?.type !== 'tab') {\n throw new Error(\n `Trigger component can only be used in the tab screen. Current route: ${route.name}`\n );\n }\n const options = convertTabPropsToOptions(props);\n navigation.setOptions(options);\n }\n }, [isFocused, props]);\n\n return null;\n}\n\nexport function convertTabPropsToOptions({\n options,\n hidden,\n children,\n disablePopToTop,\n disableScrollToTop,\n}: NativeTabTriggerProps) {\n const initialOptions: ExtendedNativeTabOptions = {\n ...options,\n hidden: !!hidden,\n specialEffects: {\n repeatedTabSelection: {\n popToRoot: !disablePopToTop,\n scrollToTop: !disableScrollToTop,\n },\n },\n };\n const allowedChildren = filterAllowedChildrenElements(children, [Badge, Label, Icon]);\n return allowedChildren.reduce<ExtendedNativeTabOptions>(\n (acc, child) => {\n if (isChildOfType(child, Badge)) {\n if (child.props.children) {\n acc.badgeValue = String(child.props.children);\n } else if (!child.props.hidden) {\n // If no value is provided, we set it to a space to show the badge\n // Otherwise, the `react-native-screens` will interpret it as a hidden badge\n // https://github.com/software-mansion/react-native-screens/blob/b4358fd95dd0736fc54df6bb97f210dc89edf24c/ios/bottom-tabs/RNSBottomTabsScreenComponentView.mm#L172\n acc.badgeValue = ' ';\n }\n } else if (isChildOfType(child, Label)) {\n if (child.props.hidden) {\n acc.title = '';\n } else {\n acc.title = child.props.children;\n }\n } else if (isChildOfType(child, Icon)) {\n if ('src' in child.props || 'selectedSrc' in child.props) {\n acc.icon = child.props.src\n ? {\n src: child.props.src,\n }\n : undefined;\n acc.selectedIcon = child.props.selectedSrc\n ? {\n src: child.props.selectedSrc,\n }\n : undefined;\n } else if ('sf' in child.props || 'selectedSf' in child.props) {\n if (process.env.EXPO_OS === 'ios') {\n acc.icon = child.props.sf\n ? {\n sf: child.props.sf,\n }\n : undefined;\n acc.selectedIcon = child.props.selectedSf\n ? {\n sf: child.props.selectedSf,\n }\n : undefined;\n }\n }\n if (process.env.EXPO_OS === 'android') {\n acc.icon = { drawable: child.props.drawable };\n acc.selectedIcon = undefined;\n }\n }\n return acc;\n },\n { ...initialOptions }\n );\n}\n\nexport function isNativeTabTrigger(\n child: ReactNode,\n contextKey?: string\n): child is ReactElement<NativeTabTriggerProps & { name: string }> {\n if (isValidElement(child) && child && child.type === NativeTabTrigger) {\n if (\n typeof child.props === 'object' &&\n child.props &&\n 'name' in child.props &&\n !child.props.name\n ) {\n throw new Error(\n `<Trigger /> component in \\`default export\\` at \\`app${contextKey}/_layout\\` must have a \\`name\\` prop when used as a child of a Layout Route.`\n );\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if (\n ['component', 'getComponent'].some(\n (key) => child.props && typeof child.props === 'object' && key in child.props\n )\n ) {\n throw new Error(\n `<Trigger /> component in \\`default export\\` at \\`app${contextKey}/_layout\\` must not have a \\`component\\` or \\`getComponent\\` prop when used as a child of a Layout Route`\n );\n }\n }\n\n return true;\n }\n\n return false;\n}\n"]}
@@ -22,22 +22,24 @@ export interface NativeTabOptions extends DefaultRouterOptions {
22
22
  */
23
23
  selectedIcon?: SfSymbolOrImageSource;
24
24
  /**
25
- * @summary Title of the tab screen, displayed in the tab bar item.
25
+ * Title of the tab screen, displayed in the tab bar item.
26
26
  *
27
- * @platform android, ios
27
+ * @platform android
28
+ * @platform iOS
28
29
  */
29
30
  title?: string;
30
31
  /**
31
- * @summary Specifies content of tab bar item badge.
32
- *
33
- * On iOS, badge is displayed as regular string.
32
+ * Specifies content of tab bar item badge.
34
33
  *
35
34
  * On Android, the value is interpreted in the following order:
36
- * - if the string can be parsed to integer, displays the value as a number;
37
- * - otherwise if the string is empty, displays "small dot" badge;
38
- * - otherwise, displays the value as a text.
35
+ * - If the string can be parsed to integer, displays the value as a number
36
+ * - Otherwise if the string is empty, displays "small dot" badge
37
+ * - Otherwise, displays the value as a text
39
38
  *
40
- * @platform android, ios
39
+ * On iOS, badge is displayed as regular string.
40
+ *
41
+ * @platform android
42
+ * @platform ios
41
43
  */
42
44
  badgeValue?: string;
43
45
  }
@@ -85,7 +87,7 @@ export interface NativeTabsStyleType {
85
87
  vertical?: number;
86
88
  };
87
89
  /**
88
- * @summary Specifies the blur effect applied to the tab bar.
90
+ * Specifies the blur effect applied to the tab bar.
89
91
  *
90
92
  * Works with backgroundColor's alpha < 1.
91
93
  *
@@ -93,12 +95,12 @@ export interface NativeTabsStyleType {
93
95
  *
94
96
  * The following values are currently supported:
95
97
  *
96
- * - `none` - disables blur effect
97
- * - `systemDefault` - uses UIKit's default tab bar blur effect
98
- * - one of styles mapped from UIKit's UIBlurEffectStyle, e.g. `systemUltraThinMaterial`
98
+ * - `none`: disables blur effect
99
+ * - `systemDefault`: uses UIKit's default tab bar blur effect
100
+ * - one of styles mapped from UIKit's UIBlurEffectStyle. For example, `systemUltraThinMaterial`
99
101
  *
100
102
  * Complete list of possible blur effect styles is available in the official UIKit documentation:
101
- * @see {@link https://developer.apple.com/documentation/uikit/uiblureffect/style|UIBlurEffect.Style}
103
+ * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uiblureffect/style)
102
104
  *
103
105
  * @default systemDefault
104
106
  *
@@ -122,18 +124,17 @@ export interface NativeTabsStyleType {
122
124
  */
123
125
  rippleColor?: ColorValue;
124
126
  /**
125
- * @summary Specifies the label visibility mode.
127
+ * Specifies the label visibility mode.
126
128
  *
127
129
  * The label visibility mode defines when the labels of each item bar should be displayed.
128
130
  *
129
131
  * The following values are available:
130
- * - `auto` - the label behaves as in labeled mode when there are 3 items or less, or as in selected mode when there are 4 items or more
131
- * - `selected` - the label is only shown on the selected navigation item
132
- * - `labeled` - the label is shown on all navigation items
133
- * - `unlabeled` - the label is hidden for all navigation items
132
+ * - `auto`: the label behaves as in "labeled" mode when there are 3 items or less, or as in "selected" mode when there are 4 items or more
133
+ * - `selected`: the label is only shown on the selected navigation item
134
+ * - `labeled`: the label is shown on all navigation items
135
+ * - `unlabeled`: the label is hidden for all navigation items
134
136
  *
135
- * The supported values correspond to the official Material Components documentation:
136
- * @see {@link https://github.com/material-components/material-components-android/blob/master/docs/components/BottomNavigation.md#making-navigation-bar-accessible|Material Components documentation}
137
+ * @see The supported values correspond to the official [Material Components documentation](https://github.com/material-components/material-components-android/blob/master/docs/components/BottomNavigation.md#making-navigation-bar-accessible).
137
138
  *
138
139
  * @default auto
139
140
  * @platform android
@@ -147,9 +148,13 @@ export interface NativeTabsStyleType {
147
148
  }
148
149
  export declare const SUPPORTED_BLUR_EFFECTS: readonly ["none", "systemDefault", "extraLight", "light", "dark", "regular", "prominent", "systemUltraThinMaterial", "systemThinMaterial", "systemMaterial", "systemThickMaterial", "systemChromeMaterial", "systemUltraThinMaterialLight", "systemThinMaterialLight", "systemMaterialLight", "systemThickMaterialLight", "systemChromeMaterialLight", "systemUltraThinMaterialDark", "systemThinMaterialDark", "systemMaterialDark", "systemThickMaterialDark", "systemChromeMaterialDark"];
149
150
  /**
150
- * @see {@link https://developer.apple.com/documentation/uikit/uiblureffect/style|UIBlurEffect.Style}
151
+ * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uiblureffect/style)
151
152
  */
152
153
  export type NativeTabsBlurEffect = (typeof SUPPORTED_BLUR_EFFECTS)[number];
154
+ /**
155
+ * @platform android
156
+ * @platform web
157
+ */
153
158
  export interface NativeTabsActiveStyleType {
154
159
  /**
155
160
  * @platform android
@@ -174,7 +179,7 @@ export interface NativeTabsActiveStyleType {
174
179
  export interface NativeTabsProps extends PropsWithChildren {
175
180
  style?: NativeTabsStyleType;
176
181
  /**
177
- * @summary Specifies the minimize behavior for the tab bar.
182
+ * Specifies the minimize behavior for the tab bar.
178
183
  *
179
184
  * Available starting from iOS 26.
180
185
  *
@@ -187,10 +192,9 @@ export interface NativeTabsProps extends PropsWithChildren {
187
192
  * - `onScrollUp` - the tab bar minimizes when scrolling up and expands
188
193
  * when scrolling back down
189
194
  *
190
- * The supported values correspond to the official UIKit documentation:
191
- * @see {@link https://developer.apple.com/documentation/uikit/uitabbarcontroller/minimizebehavior|UITabBarController.MinimizeBehavior}
195
+ * @see The supported values correspond to the official [UIKit documentation](https://developer.apple.com/documentation/uikit/uitabbarcontroller/minimizebehavior).
192
196
  *
193
- * @default Defaults to `automatic`.
197
+ * @default automatic
194
198
  *
195
199
  * @platform iOS 26+
196
200
  */
@@ -214,14 +218,14 @@ export interface NativeTabsViewProps extends NativeTabsProps {
214
218
  }
215
219
  export declare const SUPPORTED_TAB_BAR_ITEM_LABEL_VISIBILITY_MODES: readonly ["auto", "selected", "labeled", "unlabeled"];
216
220
  /**
217
- * @see {@link https://github.com/material-components/material-components-android/blob/master/docs/components/BottomNavigation.md#making-navigation-bar-accessible|Material Components documentation}
221
+ * @see [Material Components documentation](https://github.com/material-components/material-components-android/blob/master/docs/components/BottomNavigation.md#making-navigation-bar-accessible)
218
222
  *
219
223
  * @platform android
220
224
  */
221
225
  export type NativeTabsTabBarItemLabelVisibilityMode = (typeof SUPPORTED_TAB_BAR_ITEM_LABEL_VISIBILITY_MODES)[number];
222
226
  export declare const SUPPORTED_TAB_BAR_MINIMIZE_BEHAVIORS: readonly ["automatic", "never", "onScrollDown", "onScrollUp"];
223
227
  /**
224
- * @see {@link https://developer.apple.com/documentation/uikit/uitabbarcontroller/minimizebehavior|UITabBarController.MinimizeBehavior}
228
+ * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uitabbarcontroller/minimizebehavior)
225
229
  *
226
230
  * @platform iOS 26
227
231
  */
@@ -247,16 +251,16 @@ export interface NativeTabTriggerProps {
247
251
  options?: NativeTabOptions;
248
252
  /**
249
253
  * If true, the tab will not pop stack to the root when selected again.
250
- * @default false
251
254
  *
252
- * @platform ios
255
+ * @default false
256
+ * @platform iOS
253
257
  */
254
258
  disablePopToTop?: boolean;
255
259
  /**
256
260
  * If true, the tab will not scroll to the top when selected again.
257
261
  * @default false
258
262
  *
259
- * @platform ios
263
+ * @platform iOS
260
264
  */
261
265
  disableScrollToTop?: boolean;
262
266
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/native-tabs/NativeBottomTabs/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,oBAAoB,EACpB,aAAa,EACb,kBAAkB,EAClB,gBAAgB,EAChB,oBAAoB,EACrB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,KAAK,EAAE,UAAU,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC/E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEtD,MAAM,WAAW,gBAAiB,SAAQ,oBAAoB;IAC5D;;;;OAIG;IACH,IAAI,CAAC,EAAE,qBAAqB,GAAG;QAC7B;;;WAGG;QACH,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,CAAC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,CAAC,MAAM,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,KAAK,IAAI,CAAC,EACtC,gBAAgB,EAChB,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CACpB,CACF,CAAC;CACH;AAED,eAAO,MAAM,6CAA6C,uDAKhD,CAAC;AAEX;;;;GAIG;AACH,MAAM,MAAM,uCAAuC,GACjD,CAAC,OAAO,6CAA6C,CAAC,CAAC,MAAM,CAAC,CAAC;AAEjE,eAAO,MAAM,oCAAoC,+DAKvC,CAAC;AAEX;;;;GAIG;AACH,MAAM,MAAM,gCAAgC,GAC1C,CAAC,OAAO,oCAAoC,CAAC,CAAC,MAAM,CAAC,CAAC;AAExD,MAAM,WAAW,qBAAqB;IACpC;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;;OAIG;IACH,OAAO,CAAC,EAAE,gBAAgB,CAAC;IAC3B;;;;;OAKG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;;;OAKG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/native-tabs/NativeBottomTabs/types.ts"],"names":[],"mappings":";;;AAiKa,QAAA,sBAAsB,GAAG;IACpC,MAAM;IACN,eAAe;IACf,YAAY;IACZ,OAAO;IACP,MAAM;IACN,SAAS;IACT,WAAW;IACX,yBAAyB;IACzB,oBAAoB;IACpB,gBAAgB;IAChB,qBAAqB;IACrB,sBAAsB;IACtB,8BAA8B;IAC9B,yBAAyB;IACzB,qBAAqB;IACrB,0BAA0B;IAC1B,2BAA2B;IAC3B,6BAA6B;IAC7B,wBAAwB;IACxB,oBAAoB;IACpB,yBAAyB;IACzB,0BAA0B;CAClB,CAAC;AA+EE,QAAA,6CAA6C,GAAG;IAC3D,MAAM;IACN,UAAU;IACV,SAAS;IACT,WAAW;CACH,CAAC;AAUE,QAAA,oCAAoC,GAAG;IAClD,WAAW;IACX,OAAO;IACP,cAAc;IACd,YAAY;CACJ,CAAC","sourcesContent":["import type {\n DefaultRouterOptions,\n ParamListBase,\n TabNavigationState,\n TabRouterOptions,\n useNavigationBuilder,\n} from '@react-navigation/native';\nimport type { PropsWithChildren } from 'react';\nimport type { ColorValue, ImageSourcePropType, TextStyle } from 'react-native';\nimport type { BottomTabsScreenProps } from 'react-native-screens';\nimport type { SFSymbol } from 'sf-symbols-typescript';\n\nexport interface NativeTabOptions extends DefaultRouterOptions {\n /**\n * The icon to display in the tab bar.\n * @platform android\n * @platform iOS\n */\n icon?: SfSymbolOrImageSource & {\n /**\n * The name of the drawable resource to use as an icon.\n * @platform android\n */\n drawable?: string;\n };\n /**\n * The icon to display when the tab is selected.\n * @platform iOS\n */\n selectedIcon?: SfSymbolOrImageSource;\n /**\n * @summary Title of the tab screen, displayed in the tab bar item.\n *\n * @platform android, ios\n */\n title?: string;\n /**\n * @summary Specifies content of tab bar item badge.\n *\n * On iOS, badge is displayed as regular string.\n *\n * On Android, the value is interpreted in the following order:\n * - if the string can be parsed to integer, displays the value as a number;\n * - otherwise if the string is empty, displays \"small dot\" badge;\n * - otherwise, displays the value as a text.\n *\n * @platform android, ios\n */\n badgeValue?: string;\n}\n\nexport type SfSymbolOrImageSource =\n | {\n /**\n * The name of the SF Symbol to use as an icon.\n * @platform iOS\n */\n sf?: SFSymbol;\n }\n | {\n /**\n * The image source to use as an icon.\n * @platform iOS\n */\n src?: ImageSourcePropType;\n };\n\nexport interface ExtendedNativeTabOptions extends NativeTabOptions {\n /**\n * If true, the tab will be hidden from the tab bar.\n */\n hidden?: boolean;\n specialEffects?: BottomTabsScreenProps['specialEffects'];\n}\n\ntype NumericFontWeight = 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900;\n\nexport interface NativeTabsStyleType {\n fontFamily?: TextStyle['fontFamily'];\n fontSize?: TextStyle['fontSize'];\n fontWeight?: NumericFontWeight | `${NumericFontWeight}`;\n fontStyle?: TextStyle['fontStyle'];\n color?: TextStyle['color'];\n /**\n * @platform android\n * @platform iOS\n * @platform tvOS\n */\n iconColor?: ColorValue;\n backgroundColor?: ColorValue;\n /**\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uitabbaritem/titlepositionadjustment)\n *\n * @platform iOS\n */\n titlePositionAdjustment?: {\n horizontal?: number;\n vertical?: number;\n };\n /**\n * @summary Specifies the blur effect applied to the tab bar.\n *\n * Works with backgroundColor's alpha < 1.\n *\n * This property does not affect the tab bar starting from iOS 26.\n *\n * The following values are currently supported:\n *\n * - `none` - disables blur effect\n * - `systemDefault` - uses UIKit's default tab bar blur effect\n * - one of styles mapped from UIKit's UIBlurEffectStyle, e.g. `systemUltraThinMaterial`\n *\n * Complete list of possible blur effect styles is available in the official UIKit documentation:\n * @see {@link https://developer.apple.com/documentation/uikit/uiblureffect/style|UIBlurEffect.Style}\n *\n * @default systemDefault\n *\n * @platform iOS ≤ 18\n */\n blurEffect?: NativeTabsBlurEffect;\n /**\n * @platform android\n * @platform iOS\n * @platform web\n */\n tintColor?: ColorValue;\n badgeBackgroundColor?: ColorValue;\n /**\n * @platform android\n * @platform web\n */\n badgeTextColor?: ColorValue;\n /**\n * @platform android\n */\n rippleColor?: ColorValue;\n /**\n * @summary Specifies the label visibility mode.\n *\n * The label visibility mode defines when the labels of each item bar should be displayed.\n *\n * The following values are available:\n * - `auto` - the label behaves as in “labeled” mode when there are 3 items or less, or as in “selected” mode when there are 4 items or more\n * - `selected` - the label is only shown on the selected navigation item\n * - `labeled` - the label is shown on all navigation items\n * - `unlabeled` - the label is hidden for all navigation items\n *\n * The supported values correspond to the official Material Components documentation:\n * @see {@link https://github.com/material-components/material-components-android/blob/master/docs/components/BottomNavigation.md#making-navigation-bar-accessible|Material Components documentation}\n *\n * @default auto\n * @platform android\n */\n labelVisibilityMode?: NativeTabsTabBarItemLabelVisibilityMode;\n /**\n * @platform android\n * @platform web\n */\n '&:active'?: NativeTabsActiveStyleType;\n}\n\nexport const SUPPORTED_BLUR_EFFECTS = [\n 'none',\n 'systemDefault',\n 'extraLight',\n 'light',\n 'dark',\n 'regular',\n 'prominent',\n 'systemUltraThinMaterial',\n 'systemThinMaterial',\n 'systemMaterial',\n 'systemThickMaterial',\n 'systemChromeMaterial',\n 'systemUltraThinMaterialLight',\n 'systemThinMaterialLight',\n 'systemMaterialLight',\n 'systemThickMaterialLight',\n 'systemChromeMaterialLight',\n 'systemUltraThinMaterialDark',\n 'systemThinMaterialDark',\n 'systemMaterialDark',\n 'systemThickMaterialDark',\n 'systemChromeMaterialDark',\n] as const;\n\n/**\n * @see {@link https://developer.apple.com/documentation/uikit/uiblureffect/style|UIBlurEffect.Style}\n */\nexport type NativeTabsBlurEffect = (typeof SUPPORTED_BLUR_EFFECTS)[number];\n\nexport interface NativeTabsActiveStyleType {\n /**\n * @platform android\n * @platform web\n */\n color?: ColorValue;\n /**\n * @platform android\n * @platform web\n */\n fontSize?: TextStyle['fontSize'];\n /**\n * @platform android\n */\n iconColor?: ColorValue;\n /**\n * @platform android\n * @platform web\n */\n indicatorColor?: ColorValue;\n}\n\nexport interface NativeTabsProps extends PropsWithChildren {\n style?: NativeTabsStyleType;\n /**\n * @summary Specifies the minimize behavior for the tab bar.\n *\n * Available starting from iOS 26.\n *\n * The following values are currently supported:\n *\n * - `automatic` - resolves to the system default minimize behavior\n * - `never` - the tab bar does not minimize\n * - `onScrollDown` - the tab bar minimizes when scrolling down and\n * expands when scrolling back up\n * - `onScrollUp` - the tab bar minimizes when scrolling up and expands\n * when scrolling back down\n *\n * The supported values correspond to the official UIKit documentation:\n * @see {@link https://developer.apple.com/documentation/uikit/uitabbarcontroller/minimizebehavior|UITabBarController.MinimizeBehavior}\n *\n * @default Defaults to `automatic`.\n *\n * @platform iOS 26+\n */\n minimizeBehavior?: NativeTabsTabBarMinimizeBehavior;\n /**\n * Disables the active indicator for the tab bar.\n *\n * @platform android\n */\n disableIndicator?: boolean;\n /**\n * The behavior when navigating back with the back button.\n *\n * @platform android\n */\n backBehavior?: 'none' | 'initialRoute' | 'history';\n}\nexport interface NativeTabsViewProps extends NativeTabsProps {\n focusedIndex: number;\n builder: ReturnType<\n typeof useNavigationBuilder<\n TabNavigationState<ParamListBase>,\n TabRouterOptions,\n Record<string, (...args: any) => void>,\n NativeTabOptions,\n Record<string, any>\n >\n >;\n}\n\nexport const SUPPORTED_TAB_BAR_ITEM_LABEL_VISIBILITY_MODES = [\n 'auto',\n 'selected',\n 'labeled',\n 'unlabeled',\n] as const;\n\n/**\n * @see {@link https://github.com/material-components/material-components-android/blob/master/docs/components/BottomNavigation.md#making-navigation-bar-accessible|Material Components documentation}\n *\n * @platform android\n */\nexport type NativeTabsTabBarItemLabelVisibilityMode =\n (typeof SUPPORTED_TAB_BAR_ITEM_LABEL_VISIBILITY_MODES)[number];\n\nexport const SUPPORTED_TAB_BAR_MINIMIZE_BEHAVIORS = [\n 'automatic',\n 'never',\n 'onScrollDown',\n 'onScrollUp',\n] as const;\n\n/**\n * @see {@link https://developer.apple.com/documentation/uikit/uitabbarcontroller/minimizebehavior|UITabBarController.MinimizeBehavior}\n *\n * @platform iOS 26\n */\nexport type NativeTabsTabBarMinimizeBehavior =\n (typeof SUPPORTED_TAB_BAR_MINIMIZE_BEHAVIORS)[number];\n\nexport interface NativeTabTriggerProps {\n /**\n * The name of the route.\n *\n * This is required when used inside a Layout component.\n *\n * When used in a route it has no effect.\n */\n name?: string;\n /**\n * If true, the tab will be hidden from the tab bar.\n */\n hidden?: boolean;\n /**\n * The options for the trigger.\n *\n * Use `Icon`, `Label`, and `Badge` components as children to customize the tab, rather then raw options.\n */\n options?: NativeTabOptions;\n /**\n * If true, the tab will not pop stack to the root when selected again.\n * @default false\n *\n * @platform ios\n */\n disablePopToTop?: boolean;\n /**\n * If true, the tab will not scroll to the top when selected again.\n * @default false\n *\n * @platform ios\n */\n disableScrollToTop?: boolean;\n /**\n * The children of the trigger.\n *\n * Use `Icon`, `Label`, and `Badge` components to customize the tab.\n */\n children?: React.ReactNode;\n}\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/native-tabs/NativeBottomTabs/types.ts"],"names":[],"mappings":";;;AAkKa,QAAA,sBAAsB,GAAG;IACpC,MAAM;IACN,eAAe;IACf,YAAY;IACZ,OAAO;IACP,MAAM;IACN,SAAS;IACT,WAAW;IACX,yBAAyB;IACzB,oBAAoB;IACpB,gBAAgB;IAChB,qBAAqB;IACrB,sBAAsB;IACtB,8BAA8B;IAC9B,yBAAyB;IACzB,qBAAqB;IACrB,0BAA0B;IAC1B,2BAA2B;IAC3B,6BAA6B;IAC7B,wBAAwB;IACxB,oBAAoB;IACpB,yBAAyB;IACzB,0BAA0B;CAClB,CAAC;AAkFE,QAAA,6CAA6C,GAAG;IAC3D,MAAM;IACN,UAAU;IACV,SAAS;IACT,WAAW;CACH,CAAC;AAUE,QAAA,oCAAoC,GAAG;IAClD,WAAW;IACX,OAAO;IACP,cAAc;IACd,YAAY;CACJ,CAAC","sourcesContent":["import type {\n DefaultRouterOptions,\n ParamListBase,\n TabNavigationState,\n TabRouterOptions,\n useNavigationBuilder,\n} from '@react-navigation/native';\nimport type { PropsWithChildren } from 'react';\nimport type { ColorValue, ImageSourcePropType, TextStyle } from 'react-native';\nimport type { BottomTabsScreenProps } from 'react-native-screens';\nimport type { SFSymbol } from 'sf-symbols-typescript';\n\nexport interface NativeTabOptions extends DefaultRouterOptions {\n /**\n * The icon to display in the tab bar.\n * @platform android\n * @platform iOS\n */\n icon?: SfSymbolOrImageSource & {\n /**\n * The name of the drawable resource to use as an icon.\n * @platform android\n */\n drawable?: string;\n };\n /**\n * The icon to display when the tab is selected.\n * @platform iOS\n */\n selectedIcon?: SfSymbolOrImageSource;\n /**\n * Title of the tab screen, displayed in the tab bar item.\n *\n * @platform android\n * @platform iOS\n */\n title?: string;\n /**\n * Specifies content of tab bar item badge.\n *\n * On Android, the value is interpreted in the following order:\n * - If the string can be parsed to integer, displays the value as a number\n * - Otherwise if the string is empty, displays \"small dot\" badge\n * - Otherwise, displays the value as a text\n *\n * On iOS, badge is displayed as regular string.\n *\n * @platform android\n * @platform ios\n */\n badgeValue?: string;\n}\n\nexport type SfSymbolOrImageSource =\n | {\n /**\n * The name of the SF Symbol to use as an icon.\n * @platform iOS\n */\n sf?: SFSymbol;\n }\n | {\n /**\n * The image source to use as an icon.\n * @platform iOS\n */\n src?: ImageSourcePropType;\n };\n\nexport interface ExtendedNativeTabOptions extends NativeTabOptions {\n /**\n * If true, the tab will be hidden from the tab bar.\n */\n hidden?: boolean;\n specialEffects?: BottomTabsScreenProps['specialEffects'];\n}\n\ntype NumericFontWeight = 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900;\n\nexport interface NativeTabsStyleType {\n fontFamily?: TextStyle['fontFamily'];\n fontSize?: TextStyle['fontSize'];\n fontWeight?: NumericFontWeight | `${NumericFontWeight}`;\n fontStyle?: TextStyle['fontStyle'];\n color?: TextStyle['color'];\n /**\n * @platform android\n * @platform iOS\n * @platform tvOS\n */\n iconColor?: ColorValue;\n backgroundColor?: ColorValue;\n /**\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uitabbaritem/titlepositionadjustment)\n *\n * @platform iOS\n */\n titlePositionAdjustment?: {\n horizontal?: number;\n vertical?: number;\n };\n /**\n * Specifies the blur effect applied to the tab bar.\n *\n * Works with backgroundColor's alpha < 1.\n *\n * This property does not affect the tab bar starting from iOS 26.\n *\n * The following values are currently supported:\n *\n * - `none`: disables blur effect\n * - `systemDefault`: uses UIKit's default tab bar blur effect\n * - one of styles mapped from UIKit's UIBlurEffectStyle. For example, `systemUltraThinMaterial`\n *\n * Complete list of possible blur effect styles is available in the official UIKit documentation:\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uiblureffect/style)\n *\n * @default systemDefault\n *\n * @platform iOS ≤ 18\n */\n blurEffect?: NativeTabsBlurEffect;\n /**\n * @platform android\n * @platform iOS\n * @platform web\n */\n tintColor?: ColorValue;\n badgeBackgroundColor?: ColorValue;\n /**\n * @platform android\n * @platform web\n */\n badgeTextColor?: ColorValue;\n /**\n * @platform android\n */\n rippleColor?: ColorValue;\n /**\n * Specifies the label visibility mode.\n *\n * The label visibility mode defines when the labels of each item bar should be displayed.\n *\n * The following values are available:\n * - `auto`: the label behaves as in \"labeled\" mode when there are 3 items or less, or as in \"selected\" mode when there are 4 items or more\n * - `selected`: the label is only shown on the selected navigation item\n * - `labeled`: the label is shown on all navigation items\n * - `unlabeled`: the label is hidden for all navigation items\n *\n * @see The supported values correspond to the official [Material Components documentation](https://github.com/material-components/material-components-android/blob/master/docs/components/BottomNavigation.md#making-navigation-bar-accessible).\n *\n * @default auto\n * @platform android\n */\n labelVisibilityMode?: NativeTabsTabBarItemLabelVisibilityMode;\n /**\n * @platform android\n * @platform web\n */\n '&:active'?: NativeTabsActiveStyleType;\n}\n\nexport const SUPPORTED_BLUR_EFFECTS = [\n 'none',\n 'systemDefault',\n 'extraLight',\n 'light',\n 'dark',\n 'regular',\n 'prominent',\n 'systemUltraThinMaterial',\n 'systemThinMaterial',\n 'systemMaterial',\n 'systemThickMaterial',\n 'systemChromeMaterial',\n 'systemUltraThinMaterialLight',\n 'systemThinMaterialLight',\n 'systemMaterialLight',\n 'systemThickMaterialLight',\n 'systemChromeMaterialLight',\n 'systemUltraThinMaterialDark',\n 'systemThinMaterialDark',\n 'systemMaterialDark',\n 'systemThickMaterialDark',\n 'systemChromeMaterialDark',\n] as const;\n\n/**\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uiblureffect/style)\n */\nexport type NativeTabsBlurEffect = (typeof SUPPORTED_BLUR_EFFECTS)[number];\n\n/**\n * @platform android\n * @platform web\n */\nexport interface NativeTabsActiveStyleType {\n /**\n * @platform android\n * @platform web\n */\n color?: ColorValue;\n /**\n * @platform android\n * @platform web\n */\n fontSize?: TextStyle['fontSize'];\n /**\n * @platform android\n */\n iconColor?: ColorValue;\n /**\n * @platform android\n * @platform web\n */\n indicatorColor?: ColorValue;\n}\n\nexport interface NativeTabsProps extends PropsWithChildren {\n style?: NativeTabsStyleType;\n /**\n * Specifies the minimize behavior for the tab bar.\n *\n * Available starting from iOS 26.\n *\n * The following values are currently supported:\n *\n * - `automatic` - resolves to the system default minimize behavior\n * - `never` - the tab bar does not minimize\n * - `onScrollDown` - the tab bar minimizes when scrolling down and\n * expands when scrolling back up\n * - `onScrollUp` - the tab bar minimizes when scrolling up and expands\n * when scrolling back down\n *\n * @see The supported values correspond to the official [UIKit documentation](https://developer.apple.com/documentation/uikit/uitabbarcontroller/minimizebehavior).\n *\n * @default automatic\n *\n * @platform iOS 26+\n */\n minimizeBehavior?: NativeTabsTabBarMinimizeBehavior;\n /**\n * Disables the active indicator for the tab bar.\n *\n * @platform android\n */\n disableIndicator?: boolean;\n /**\n * The behavior when navigating back with the back button.\n *\n * @platform android\n */\n backBehavior?: 'none' | 'initialRoute' | 'history';\n}\nexport interface NativeTabsViewProps extends NativeTabsProps {\n focusedIndex: number;\n builder: ReturnType<\n typeof useNavigationBuilder<\n TabNavigationState<ParamListBase>,\n TabRouterOptions,\n Record<string, (...args: any) => void>,\n NativeTabOptions,\n Record<string, any>\n >\n >;\n}\n\nexport const SUPPORTED_TAB_BAR_ITEM_LABEL_VISIBILITY_MODES = [\n 'auto',\n 'selected',\n 'labeled',\n 'unlabeled',\n] as const;\n\n/**\n * @see [Material Components documentation](https://github.com/material-components/material-components-android/blob/master/docs/components/BottomNavigation.md#making-navigation-bar-accessible)\n *\n * @platform android\n */\nexport type NativeTabsTabBarItemLabelVisibilityMode =\n (typeof SUPPORTED_TAB_BAR_ITEM_LABEL_VISIBILITY_MODES)[number];\n\nexport const SUPPORTED_TAB_BAR_MINIMIZE_BEHAVIORS = [\n 'automatic',\n 'never',\n 'onScrollDown',\n 'onScrollUp',\n] as const;\n\n/**\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uitabbarcontroller/minimizebehavior)\n *\n * @platform iOS 26\n */\nexport type NativeTabsTabBarMinimizeBehavior =\n (typeof SUPPORTED_TAB_BAR_MINIMIZE_BEHAVIORS)[number];\n\nexport interface NativeTabTriggerProps {\n /**\n * The name of the route.\n *\n * This is required when used inside a Layout component.\n *\n * When used in a route it has no effect.\n */\n name?: string;\n /**\n * If true, the tab will be hidden from the tab bar.\n */\n hidden?: boolean;\n /**\n * The options for the trigger.\n *\n * Use `Icon`, `Label`, and `Badge` components as children to customize the tab, rather then raw options.\n */\n options?: NativeTabOptions;\n /**\n * If true, the tab will not pop stack to the root when selected again.\n *\n * @default false\n * @platform iOS\n */\n disablePopToTop?: boolean;\n /**\n * If true, the tab will not scroll to the top when selected again.\n * @default false\n *\n * @platform iOS\n */\n disableScrollToTop?: boolean;\n /**\n * The children of the trigger.\n *\n * Use `Icon`, `Label`, and `Badge` components to customize the tab.\n */\n children?: React.ReactNode;\n}\n"]}
@@ -159,6 +159,6 @@ function useFocusEffect(effect, do_not_pass_a_second_prop) {
159
159
  unsubscribeFocus();
160
160
  unsubscribeBlur();
161
161
  };
162
- }, [effect, navigation, optionalNavigation, navigation.isFocused()]);
162
+ }, [effect, navigation, optionalNavigation]);
163
163
  }
164
164
  //# sourceMappingURL=useFocusEffect.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useFocusEffect.js","sourceRoot":"","sources":["../src/useFocusEffect.ts"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+Cb,wCAuGC;AArJD,gFAAgF;AAChF,sEAAsE;AACtE,6CAA+B;AAE/B,oEAAmE;AACnE,mDAAgD;AAOhD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,SAAgB,cAAc,CAAC,MAAsB,EAAE,yBAAiC;IACtF,MAAM,kBAAkB,GAAG,IAAA,2CAAqB,GAAE,CAAC;IACnD,MA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OAAO,CAAC,IAAI,CAAC;gBAC3D,CAAC;gBAED,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;YACzB,CAAC;QACH,CAAC,CAAC;QAEF,mFAAmF;QACnF,IAAI,UAAU,CAAC,SAAS,EAAE,EAAE,CAAC;YAC3B,OAAO,GAAG,QAAQ,EAAE,CAAC;YACrB,SAAS,GAAG,IAAI,CAAC;QACnB,CAAC;QAED,MAAM,gBAAgB,GAAG,UAAU,CAAC,WAAW,CAAC,OAAO,EAAE,GAAG,EAAE;YAC5D,mEAAmE;YACnE,gGAAgG;YAChG,IAAI,SAAS,EAAE,CAAC;gBACd,OAAO;YACT,CAAC;YAED,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;gBAC1B,OAAO,EAAE,CAAC;YACZ,CAAC;YAED,OAAO,GAAG,QAAQ,EAAE,CAAC;YACrB,SAAS,GAAG,IAAI,CAAC;QACnB,CAAC,CAAC,CAAC;QAEH,MAAM,eAAe,GAAG,UAAU,CAAC,WAAW,CAAC,MAAM,EAAE,GAAG,EAAE;YAC1D,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;gBAC1B,OAAO,EAAE,CAAC;YACZ,CAAC;YAED,OAAO,GAAG,SAAS,CAAC;YACpB,SAAS,GAAG,KAAK,CAAC;QACpB,CAAC,CAAC,CAAC;QAEH,OAAO,GAAG,EAAE;YACV,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;gBAC1B,OAAO,EAAE,CAAC;YACZ,CAAC;YAED,gBAAgB,EAAE,CAAC;YACnB,eAAe,EAAE,CAAC;QACpB,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,MAAM,EAAE,UAAU,EAAE,kBAAkB,EAAE,UAAU,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;AACvE,CAAC","sourcesContent":["'use client';\n// A fork of `useFocusEffect` that waits for the navigation state to load before\n// running the effect. This is especially useful for native redirects.\nimport * as React from 'react';\n\nimport { useOptionalNavigation } from './link/useLoadedNavigation';\nimport { useNavigation } from './useNavigation';\n\n/**\n * Memoized callback containing the effect, should optionally return a cleanup function.\n */\nexport type EffectCallback = () => undefined | void | (() => void);\n\n/**\n * Hook to run an effect whenever a route is **focused**. Similar to\n * [`React.useEffect`](https://react.dev/reference/react/useEffect).\n *\n * This can be used to perform side-effects such as fetching data or subscribing to events.\n * The passed callback should be wrapped in [`React.useCallback`](https://react.dev/reference/react/useCallback)\n * to avoid running the effect too often.\n *\n * @example\n * ```tsx\n * import { useFocusEffect } from 'expo-router';\n * import { useCallback } from 'react';\n *\n * export default function Route() {\n * useFocusEffect(\n * // Callback should be wrapped in `React.useCallback` to avoid running the effect too often.\n * useCallback(() => {\n * // Invoked whenever the route is focused.\n * console.log(\"Hello, I'm focused!\");\n *\n * // Return function is invoked whenever the route gets out of focus.\n * return () => {\n * console.log('This route is now unfocused.');\n * };\n * }, []),\n * );\n *\n * return </>;\n * }\n *```\n *\n * @param effect Memoized callback containing the effect, should optionally return a cleanup function.\n * @param do_not_pass_a_second_prop\n */\nexport function useFocusEffect(effect: EffectCallback, do_not_pass_a_second_prop?: never) {\n const optionalNavigation = useOptionalNavigation();\n const navigation = useNavigation();\n\n if (do_not_pass_a_second_prop !== undefined) {\n const message =\n \"You passed a second argument to 'useFocusEffect', but it only accepts one argument. \" +\n \"If you want to pass a dependency array, you can use 'React.useCallback':\\n\\n\" +\n 'useFocusEffect(\\n' +\n ' React.useCallback(() => {\\n' +\n ' // Your code here\\n' +\n ' }, [depA, depB])\\n' +\n ');\\n\\n' +\n 'See usage guide: https://reactnavigation.org/docs/use-focus-effect';\n\n console.error(message);\n }\n\n React.useEffect(() => {\n if (!navigation || !optionalNavigation) {\n return;\n }\n\n let isFocused = false;\n let cleanup: undefined | void | (() => void);\n\n const callback = () => {\n const destroy = effect();\n\n if (destroy === undefined || typeof destroy === 'function') {\n return destroy;\n }\n\n if (process.env.NODE_ENV !== 'production') {\n let message =\n 'An effect function must not return anything besides a function, which is used for clean-up.';\n\n if (destroy === null) {\n message +=\n \" You returned 'null'. If your effect does not require clean-up, return 'undefined' (or nothing).\";\n } else if (typeof (destroy as any).then === 'function') {\n message +=\n \"\\n\\nIt looks like you wrote 'useFocusEffect(async () => ...)' or returned a Promise. \" +\n 'Instead, write the async function inside your effect ' +\n 'and call it immediately:\\n\\n' +\n 'useFocusEffect(\\n' +\n ' React.useCallback(() => {\\n' +\n ' async function fetchData() {\\n' +\n ' // You can await here\\n' +\n ' const response = await MyAPI.getData(someId);\\n' +\n ' // ...\\n' +\n ' }\\n\\n' +\n ' fetchData();\\n' +\n ' }, [someId])\\n' +\n ');\\n\\n' +\n 'See usage guide: https://reactnavigation.org/docs/use-focus-effect';\n } else {\n message += ` You returned '${JSON.stringify(destroy)}'.`;\n }\n\n console.error(message);\n }\n };\n\n // We need to run the effect on initial render/dep changes if the screen is focused\n if (navigation.isFocused()) {\n cleanup = callback();\n isFocused = true;\n }\n\n const unsubscribeFocus = navigation.addListener('focus', () => {\n // If callback was already called for focus, avoid calling it again\n // The focus event may also fire on initial render, so we guard against running the effect twice\n if (isFocused) {\n return;\n }\n\n if (cleanup !== undefined) {\n cleanup();\n }\n\n cleanup = callback();\n isFocused = true;\n });\n\n const unsubscribeBlur = navigation.addListener('blur', () => {\n if (cleanup !== undefined) {\n cleanup();\n }\n\n cleanup = undefined;\n isFocused = false;\n });\n\n return () => {\n if (cleanup !== undefined) {\n cleanup();\n }\n\n unsubscribeFocus();\n unsubscribeBlur();\n };\n }, [effect, navigation, optionalNavigation, navigation.isFocused()]);\n}\n"]}
1
+ {"version":3,"file":"useFocusEffect.js","sourceRoot":"","sources":["../src/useFocusEffect.ts"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+Cb,wCAuGC;AArJD,gFAAgF;AAChF,sEAAsE;AACtE,6CAA+B;AAE/B,oEAAmE;AACnE,mDAAgD;AAOhD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;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to load before\n// running the effect. This is especially useful for native redirects.\nimport * as React from 'react';\n\nimport { useOptionalNavigation } from './link/useLoadedNavigation';\nimport { useNavigation } from './useNavigation';\n\n/**\n * Memoized callback containing the effect, should optionally return a cleanup function.\n */\nexport type EffectCallback = () => undefined | void | (() => void);\n\n/**\n * Hook to run an effect whenever a route is **focused**. Similar to\n * [`React.useEffect`](https://react.dev/reference/react/useEffect).\n *\n * This can be used to perform side-effects such as fetching data or subscribing to events.\n * The passed callback should be wrapped in [`React.useCallback`](https://react.dev/reference/react/useCallback)\n * to avoid running the effect too often.\n *\n * @example\n * ```tsx\n * import { useFocusEffect } from 'expo-router';\n * import { useCallback } from 'react';\n *\n * export default function Route() {\n * useFocusEffect(\n * // Callback should be wrapped in `React.useCallback` to avoid running the effect too often.\n * useCallback(() => {\n * // Invoked whenever the route is focused.\n * console.log(\"Hello, I'm focused!\");\n *\n * // Return function is invoked whenever the route gets out of focus.\n * return () => {\n * console.log('This route is now unfocused.');\n * };\n * }, []),\n * );\n *\n * return </>;\n * }\n *```\n *\n * @param effect Memoized callback containing the effect, should optionally return a cleanup function.\n * @param do_not_pass_a_second_prop\n */\nexport function useFocusEffect(effect: EffectCallback, do_not_pass_a_second_prop?: never) {\n const optionalNavigation = useOptionalNavigation();\n const navigation = useNavigation();\n\n if (do_not_pass_a_second_prop !== undefined) {\n const message =\n \"You passed a second argument to 'useFocusEffect', but it only accepts one argument. \" +\n \"If you want to pass a dependency array, you can use 'React.useCallback':\\n\\n\" +\n 'useFocusEffect(\\n' +\n ' React.useCallback(() => {\\n' +\n ' // Your code here\\n' +\n ' }, [depA, depB])\\n' +\n ');\\n\\n' +\n 'See usage guide: https://reactnavigation.org/docs/use-focus-effect';\n\n console.error(message);\n }\n\n React.useEffect(() => {\n if (!navigation || !optionalNavigation) {\n return;\n }\n\n let isFocused = false;\n let cleanup: undefined | void | (() => void);\n\n const callback = () => {\n const destroy = effect();\n\n if (destroy === undefined || typeof destroy === 'function') {\n return destroy;\n }\n\n if (process.env.NODE_ENV !== 'production') {\n let message =\n 'An effect function must not return anything besides a function, which is used for clean-up.';\n\n if (destroy === null) {\n message +=\n \" You returned 'null'. If your effect does not require clean-up, return 'undefined' (or nothing).\";\n } else if (typeof (destroy as any).then === 'function') {\n message +=\n \"\\n\\nIt looks like you wrote 'useFocusEffect(async () => ...)' or returned a Promise. \" +\n 'Instead, write the async function inside your effect ' +\n 'and call it immediately:\\n\\n' +\n 'useFocusEffect(\\n' +\n ' React.useCallback(() => {\\n' +\n ' async function fetchData() {\\n' +\n ' // You can await here\\n' +\n ' const response = await MyAPI.getData(someId);\\n' +\n ' // ...\\n' +\n ' }\\n\\n' +\n ' fetchData();\\n' +\n ' }, [someId])\\n' +\n ');\\n\\n' +\n 'See usage guide: https://reactnavigation.org/docs/use-focus-effect';\n } else {\n message += ` You returned '${JSON.stringify(destroy)}'.`;\n }\n\n console.error(message);\n }\n };\n\n // We need to run the effect on initial render/dep changes if the screen is focused\n if (navigation.isFocused()) {\n cleanup = callback();\n isFocused = true;\n }\n\n const unsubscribeFocus = navigation.addListener('focus', () => {\n // If callback was already called for focus, avoid calling it again\n // The focus event may also fire on initial render, so we guard against running the effect twice\n if (isFocused) {\n return;\n }\n\n if (cleanup !== undefined) {\n cleanup();\n }\n\n cleanup = callback();\n isFocused = true;\n });\n\n const unsubscribeBlur = navigation.addListener('blur', () => {\n if (cleanup !== undefined) {\n cleanup();\n }\n\n cleanup = undefined;\n isFocused = false;\n });\n\n return () => {\n if (cleanup !== undefined) {\n cleanup();\n }\n\n unsubscribeFocus();\n unsubscribeBlur();\n };\n }, [effect, navigation, optionalNavigation]);\n}\n"]}
@@ -19,7 +19,7 @@ public class LinkPreviewNativeModule: Module {
19
19
  "onWillPreviewOpen",
20
20
  "onDidPreviewOpen",
21
21
  "onPreviewWillClose",
22
- "onPreviewDidClose",
22
+ "onPreviewDidClose"
23
23
  )
24
24
  }
25
25
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-router",
3
- "version": "6.0.0-beta.4",
3
+ "version": "6.0.0-beta.5",
4
4
  "description": "Expo Router is a file-based router for React Native and web applications.",
5
5
  "author": "650 Industries, Inc.",
6
6
  "license": "MIT",
@@ -80,7 +80,7 @@
80
80
  "@react-navigation/drawer": "^7.5.0",
81
81
  "@testing-library/react-native": ">= 12.0.0",
82
82
  "expo": "*",
83
- "expo-constants": "^18.0.2",
83
+ "expo-constants": "^18.0.3",
84
84
  "expo-linking": "^8.0.2",
85
85
  "react": "*",
86
86
  "react-dom": "*",
@@ -151,5 +151,5 @@
151
151
  "use-latest-callback": "^0.2.1",
152
152
  "vaul": "^1.1.2"
153
153
  },
154
- "gitHead": "de2ce610a804a8f3ddcee6ea9474543e81b903bd"
154
+ "gitHead": "3275774c9286477adba9bc226d3923a996217ee4"
155
155
  }