expo-router 56.2.3 → 56.2.4

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.
Files changed (52) hide show
  1. package/android/build.gradle +2 -2
  2. package/build/global-state/router.d.ts +5 -2
  3. package/build/global-state/router.d.ts.map +1 -1
  4. package/build/global-state/router.js.map +1 -1
  5. package/build/hooks/useRootNavigationState.d.ts +7 -2
  6. package/build/hooks/useRootNavigationState.d.ts.map +1 -1
  7. package/build/hooks/useRootNavigationState.js +7 -2
  8. package/build/hooks/useRootNavigationState.js.map +1 -1
  9. package/build/useFocusEffect.d.ts +5 -2
  10. package/build/useFocusEffect.d.ts.map +1 -1
  11. package/build/useFocusEffect.js +7 -4
  12. package/build/useFocusEffect.js.map +1 -1
  13. package/build/useNavigation.d.ts +6 -4
  14. package/build/useNavigation.d.ts.map +1 -1
  15. package/build/useNavigation.js +6 -4
  16. package/build/useNavigation.js.map +1 -1
  17. package/expo-module.config.json +1 -1
  18. package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.3/expo.modules.router-56.2.3.module → 56.2.4/expo.modules.router-56.2.4.module} +7 -7
  19. package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.4/expo.modules.router-56.2.4.module.md5 +1 -0
  20. package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.4/expo.modules.router-56.2.4.module.sha1 +1 -0
  21. package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.4/expo.modules.router-56.2.4.module.sha256 +1 -0
  22. package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.4/expo.modules.router-56.2.4.module.sha512 +1 -0
  23. package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.3/expo.modules.router-56.2.3.pom → 56.2.4/expo.modules.router-56.2.4.pom} +1 -1
  24. package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.4/expo.modules.router-56.2.4.pom.md5 +1 -0
  25. package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.4/expo.modules.router-56.2.4.pom.sha1 +1 -0
  26. package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.4/expo.modules.router-56.2.4.pom.sha256 +1 -0
  27. package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.4/expo.modules.router-56.2.4.pom.sha512 +1 -0
  28. package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml +4 -4
  29. package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml.md5 +1 -1
  30. package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml.sha1 +1 -1
  31. package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml.sha256 +1 -1
  32. package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml.sha512 +1 -1
  33. package/package.json +3 -3
  34. package/plugin/tsconfig.tsbuildinfo +1 -1
  35. package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.3/expo.modules.router-56.2.3.module.md5 +0 -1
  36. package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.3/expo.modules.router-56.2.3.module.sha1 +0 -1
  37. package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.3/expo.modules.router-56.2.3.module.sha256 +0 -1
  38. package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.3/expo.modules.router-56.2.3.module.sha512 +0 -1
  39. package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.3/expo.modules.router-56.2.3.pom.md5 +0 -1
  40. package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.3/expo.modules.router-56.2.3.pom.sha1 +0 -1
  41. package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.3/expo.modules.router-56.2.3.pom.sha256 +0 -1
  42. package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.3/expo.modules.router-56.2.3.pom.sha512 +0 -1
  43. /package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.3/expo.modules.router-56.2.3-sources.jar → 56.2.4/expo.modules.router-56.2.4-sources.jar} +0 -0
  44. /package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.3/expo.modules.router-56.2.3-sources.jar.md5 → 56.2.4/expo.modules.router-56.2.4-sources.jar.md5} +0 -0
  45. /package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.3/expo.modules.router-56.2.3-sources.jar.sha1 → 56.2.4/expo.modules.router-56.2.4-sources.jar.sha1} +0 -0
  46. /package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.3/expo.modules.router-56.2.3-sources.jar.sha256 → 56.2.4/expo.modules.router-56.2.4-sources.jar.sha256} +0 -0
  47. /package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.3/expo.modules.router-56.2.3-sources.jar.sha512 → 56.2.4/expo.modules.router-56.2.4-sources.jar.sha512} +0 -0
  48. /package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.3/expo.modules.router-56.2.3.aar → 56.2.4/expo.modules.router-56.2.4.aar} +0 -0
  49. /package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.3/expo.modules.router-56.2.3.aar.md5 → 56.2.4/expo.modules.router-56.2.4.aar.md5} +0 -0
  50. /package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.3/expo.modules.router-56.2.3.aar.sha1 → 56.2.4/expo.modules.router-56.2.4.aar.sha1} +0 -0
  51. /package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.3/expo.modules.router-56.2.3.aar.sha256 → 56.2.4/expo.modules.router-56.2.4.aar.sha256} +0 -0
  52. /package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.3/expo.modules.router-56.2.3.aar.sha512 → 56.2.4/expo.modules.router-56.2.4.aar.sha512} +0 -0
@@ -4,13 +4,13 @@ plugins {
4
4
  }
5
5
 
6
6
  group = 'expo.modules.router'
7
- version = '56.2.3'
7
+ version = '56.2.4'
8
8
 
9
9
  android {
10
10
  namespace "expo.modules.router"
11
11
  defaultConfig {
12
12
  versionCode 1
13
- versionName "56.2.3"
13
+ versionName "56.2.4"
14
14
  }
15
15
  lintOptions {
16
16
  abortOnError false
@@ -65,8 +65,11 @@ export type ImperativeRouter = {
65
65
  */
66
66
  dismissTo: (href: Href, options?: NavigationOptions) => void;
67
67
  /**
68
- * Returns to the first screen in the closest stack. This is similar to
69
- * [`popToTop`](https://reactnavigation.org/docs/stack-actions/#poptotop) stack action.
68
+ * Returns to the first screen of the closest stack equivalent to a stack
69
+ * `popToTop` action.
70
+ *
71
+ * @see React Navigation's [`popToTop`](https://reactnavigation.org/docs/stack-actions/#poptotop)
72
+ * stack action for the underlying behavior.
70
73
  */
71
74
  dismissAll: () => void;
72
75
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../src/global-state/router.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAShE,OAAO,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAGlE,wBAAgB,QAAQ,CAAC,GAAG,EAAE,IAAI,EAAE,OAAO,CAAC,EAAE,iBAAiB,QAE9D;AAED,wBAAgB,MAAM,SAGrB;AAED,wBAAgB,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,EAAE,iBAAiB,QAE/D;AAED,wBAAgB,IAAI,CAAC,GAAG,EAAE,IAAI,EAAE,OAAO,CAAC,EAAE,iBAAiB,QAE1D;AAED,wBAAgB,OAAO,CAAC,KAAK,GAAE,MAAU,QAMxC;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,EAAE,iBAAiB,QAEhE;AAED,wBAAgB,OAAO,CAAC,GAAG,EAAE,IAAI,EAAE,OAAO,CAAC,EAAE,iBAAiB,QAE7D;AAED,wBAAgB,UAAU,SAKzB;AAED,wBAAgB,MAAM,SAMrB;AAED,wBAAgB,SAAS,IAAI,OAAO,CAenC;AAED,wBAAgB,UAAU,IAAI,OAAO,CAmBpC;AAED,wBAAgB,SAAS,CACvB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AI,aAAa,IAAI,IAAI,EAAE,CAAC;YAC1B,MAAM,IAAI,KAAK,CACb,kFAAkF,CACnF,CAAC;QACJ,CAAC;QAED,IAAI,CAAC,aAAK,CAAC,OAAO,EAAE,CAAC;YACnB,MAAM,IAAI,KAAK,CAAC,uDAAuD,CAAC,CAAC;QAC3E,CAAC;QAED,aAAa,CAAC,MAAM,EAAE,CAAC;QACvB,OAAO;IACT,CAAC;IAED,MAAM,UAAU,GAAG;QACjB,IAAI,EAAE,aAAsB;QAC5B,OAAO,EAAE;YACP,IAAI;YACJ,OAAO;SACR;KACF,CAAC;IAEF,2BAAY,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;AAC/B,CAAC;AA+ED;;GAEG;AACU,QAAA,MAAM,GAAqB;IACtC,QAAQ;IACR,IAAI;IACJ,OAAO;IACP,UAAU;IACV,SAAS;IACT,UAAU;IACV,OAAO;IACP,IAAI,EAAE,GAAG,EAAE,CAAC,MAAM,EAAE;IACpB,SAAS;IACT,MAAM;IACN,QAAQ;IACR,SAAS,EAAE,SAA0C;CACtD,CAAC","sourcesContent":["import { IS_DOM } from 'expo/dom';\nimport * as Linking from 'expo-linking';\nimport { Platform } from 'react-native';\n\nimport { routingQueue } from './routingQueue';\nimport { store } from './store';\nimport type { LinkToOptions, NavigationOptions } from './types';\nimport {\n emitDomDismiss,\n emitDomDismissAll,\n emitDomGoBack,\n emitDomLinkEvent,\n emitDomSetParams,\n} from '../domComponents/emitDomEvent';\nimport { resolveHref } from '../link/href';\nimport type { Href, RoutePath, RouteInputParams } from '../types';\nimport { shouldLinkExternally } from '../utils/url';\n\nexport function navigate(url: Href, options?: NavigationOptions) {\n return linkTo(resolveHref(url), { ...options, event: 'NAVIGATE' });\n}\n\nexport function reload() {\n // TODO(EvanBacon): add `reload` support.\n throw new Error('The reload method is not implemented in the client-side router yet.');\n}\n\nexport function prefetch(href: Href, options?: NavigationOptions) {\n return linkTo(resolveHref(href), { ...options, event: 'PRELOAD' });\n}\n\nexport function push(url: Href, options?: NavigationOptions) {\n return linkTo(resolveHref(url), { ...options, event: 'PUSH' });\n}\n\nexport function dismiss(count: number = 1) {\n if (emitDomDismiss(count)) {\n return;\n }\n\n routingQueue.add({ type: 'POP', payload: { count } });\n}\n\nexport function dismissTo(href: Href, options?: NavigationOptions) {\n return linkTo(resolveHref(href), { ...options, event: 'POP_TO' });\n}\n\nexport function replace(url: Href, options?: NavigationOptions) {\n return linkTo(resolveHref(url), { ...options, event: 'REPLACE' });\n}\n\nexport function dismissAll() {\n if (emitDomDismissAll()) {\n return;\n }\n routingQueue.add({ type: 'POP_TO_TOP' });\n}\n\nexport function goBack() {\n if (emitDomGoBack()) {\n return;\n }\n store.assertIsReady();\n routingQueue.add({ type: 'GO_BACK' });\n}\n\nexport function canGoBack(): boolean {\n if (IS_DOM) {\n throw new Error(\n 'canGoBack imperative method is not supported. Pass the property to the DOM component instead.'\n );\n }\n // Return a default value here if the navigation hasn't mounted yet.\n // This can happen if the user calls `canGoBack` from the Root Layout route\n // before mounting a navigator. This behavior exists due to React Navigation being dynamically\n // constructed at runtime. We can get rid of this in the future if we use\n // the static configuration internally.\n if (!store.navigationRef.isReady()) {\n return false;\n }\n return store.navigationRef?.current?.canGoBack() ?? false;\n}\n\nexport function canDismiss(): boolean {\n if (IS_DOM) {\n throw new Error(\n 'canDismiss imperative method is not supported. Pass the property to the DOM component instead.'\n );\n }\n let state = store.state;\n\n // Keep traversing down the state tree until we find a stack navigator that we can pop\n while (state) {\n if (state.type === 'stack' && state.routes.length > 1) {\n return true;\n }\n if (state.index === undefined) return false;\n\n state = state.routes?.[state.index]?.state as any;\n }\n\n return false;\n}\n\nexport function setParams(\n params: Record<string, undefined | string | number | (string | number)[]> = {}\n) {\n if (emitDomSetParams(params)) {\n return;\n }\n store.assertIsReady();\n return (store.navigationRef?.current?.setParams as any)(params);\n}\n\nexport function linkTo(originalHref: Href, options: LinkToOptions = {}) {\n originalHref = typeof originalHref == 'string' ? originalHref : resolveHref(originalHref);\n let href: string | undefined | null = originalHref;\n\n if (emitDomLinkEvent(href, options)) {\n return;\n }\n\n if (shouldLinkExternally(href)) {\n if (href.startsWith('//') && Platform.OS !== 'web') {\n href = `https:${href}`;\n }\n\n Linking.openURL(href);\n return;\n }\n\n if (href === '..' || href === '../') {\n store.assertIsReady();\n const navigationRef = store.navigationRef.current;\n\n if (navigationRef == null) {\n throw new Error(\n \"Couldn't find a navigation object. Is your component inside NavigationContainer?\"\n );\n }\n\n if (!store.linking) {\n throw new Error('Attempted to link to route when no routes are present');\n }\n\n navigationRef.goBack();\n return;\n }\n\n const linkAction = {\n type: 'ROUTER_LINK' as const,\n payload: {\n href,\n options,\n },\n };\n\n routingQueue.add(linkAction);\n}\n\n/**\n * Returns `router` object for imperative navigation API.\n *\n * @example\n *```tsx\n * import { router } from 'expo-router';\n * import { Text } from 'react-native';\n *\n * export default function Route() {\n *\n * return (\n * <Text onPress={() => router.push('/home')}>Go Home</Text>\n * );\n *}\n * ```\n */\nexport type ImperativeRouter = {\n /**\n * Goes back in the navigation history.\n */\n back: () => void;\n /**\n * Navigates to a route in the navigator's history if it supports invoking the `back` function.\n */\n canGoBack: () => boolean;\n /**\n * Navigates to the provided [`href`](#href) using a push operation if possible.\n */\n push: (href: Href, options?: NavigationOptions) => void;\n /**\n * Navigates to the provided [`href`](#href).\n */\n navigate: (href: Href, options?: NavigationOptions) => void;\n /**\n * Navigates to route without appending to the history. Can be used with\n * [`useFocusEffect`](#usefocuseffecteffect-do_not_pass_a_second_prop)\n * to redirect imperatively to a new screen.\n *\n * @see [Using `useRouter()` hook](/router/reference/redirects/) to redirect.\n * */\n replace: (href: Href, options?: NavigationOptions) => void;\n /**\n * Navigates to the a stack lower than the current screen using the provided count if possible, otherwise 1.\n *\n * If the current screen is the only route, it will dismiss the entire stack.\n */\n dismiss: (count?: number) => void;\n /**\n * Dismisses screens until the provided href is reached. If the href is not found, it will instead replace the current screen with the provided `href`.\n */\n dismissTo: (href: Href, options?: NavigationOptions) => void;\n /**\n * Returns to the first screen in the closest stack. This is similar to\n * [`popToTop`](https://reactnavigation.org/docs/stack-actions/#poptotop) stack action.\n */\n dismissAll: () => void;\n /**\n * Checks if it is possible to dismiss the current screen. Returns `true` if the\n * router is within the stack with more than one screen in stack's history.\n *\n */\n canDismiss: () => boolean;\n /**\n * Updates the current route's query params.\n */\n setParams: <T extends RoutePath>(params: Partial<RouteInputParams<T>>) => void;\n /**\n * Reloads the currently mounted route in experimental server mode. This can be used to re-fetch data.\n * @hidden\n */\n reload: () => void;\n /**\n * Prefetch a screen in the background before navigating to it\n */\n prefetch: (name: Href) => void;\n};\n\n/**\n * @hidden\n */\nexport const router: ImperativeRouter = {\n navigate,\n push,\n dismiss,\n dismissAll,\n dismissTo,\n canDismiss,\n replace,\n back: () => goBack(),\n canGoBack,\n reload,\n prefetch,\n setParams: setParams as ImperativeRouter['setParams'],\n};\n"]}
1
+ {"version":3,"file":"router.js","sourceRoot":"","sources":["../../src/global-state/router.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBA,4BAEC;AAED,wBAGC;AAED,4BAEC;AAED,oBAEC;AAED,0BAMC;AAED,8BAEC;AAED,0BAEC;AAED,gCAKC;AAED,wBAMC;AAED,8BAeC;AAED,gCAmBC;AAED,8BAQC;AAED,wBA4CC;AA9JD,kCAAkC;AAClC,sDAAwC;AACxC,+CAAwC;AAExC,iDAA8C;AAC9C,mCAAgC;AAEhC,gEAMuC;AACvC,uCAA2C;AAE3C,sCAAoD;AAEpD,SAAgB,QAAQ,CAAC,GAAS,EAAE,OAA2B;IAC7D,OAAO,MAAM,CAAC,IAAA,kBAAW,EAAC,GAAG,CAAC,EAAE,EAAE,GAAG,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,CAAC;AACrE,CAAC;AAED,SAAgB,MAAM;IACpB,yCAAyC;IACzC,MAAM,IAAI,KAAK,CAAC,qEAAqE,CAAC,CAAC;AACzF,CAAC;AAED,SAA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,MAAM,GAAqB;IACtC,QAAQ;IACR,IAAI;IACJ,OAAO;IACP,UAAU;IACV,SAAS;IACT,UAAU;IACV,OAAO;IACP,IAAI,EAAE,GAAG,EAAE,CAAC,MAAM,EAAE;IACpB,SAAS;IACT,MAAM;IACN,QAAQ;IACR,SAAS,EAAE,SAA0C;CACtD,CAAC","sourcesContent":["import { IS_DOM } from 'expo/dom';\nimport * as Linking from 'expo-linking';\nimport { Platform } from 'react-native';\n\nimport { routingQueue } from './routingQueue';\nimport { store } from './store';\nimport type { LinkToOptions, NavigationOptions } from './types';\nimport {\n emitDomDismiss,\n emitDomDismissAll,\n emitDomGoBack,\n emitDomLinkEvent,\n emitDomSetParams,\n} from '../domComponents/emitDomEvent';\nimport { resolveHref } from '../link/href';\nimport type { Href, RoutePath, RouteInputParams } from '../types';\nimport { shouldLinkExternally } from '../utils/url';\n\nexport function navigate(url: Href, options?: NavigationOptions) {\n return linkTo(resolveHref(url), { ...options, event: 'NAVIGATE' });\n}\n\nexport function reload() {\n // TODO(EvanBacon): add `reload` support.\n throw new Error('The reload method is not implemented in the client-side router yet.');\n}\n\nexport function prefetch(href: Href, options?: NavigationOptions) {\n return linkTo(resolveHref(href), { ...options, event: 'PRELOAD' });\n}\n\nexport function push(url: Href, options?: NavigationOptions) {\n return linkTo(resolveHref(url), { ...options, event: 'PUSH' });\n}\n\nexport function dismiss(count: number = 1) {\n if (emitDomDismiss(count)) {\n return;\n }\n\n routingQueue.add({ type: 'POP', payload: { count } });\n}\n\nexport function dismissTo(href: Href, options?: NavigationOptions) {\n return linkTo(resolveHref(href), { ...options, event: 'POP_TO' });\n}\n\nexport function replace(url: Href, options?: NavigationOptions) {\n return linkTo(resolveHref(url), { ...options, event: 'REPLACE' });\n}\n\nexport function dismissAll() {\n if (emitDomDismissAll()) {\n return;\n }\n routingQueue.add({ type: 'POP_TO_TOP' });\n}\n\nexport function goBack() {\n if (emitDomGoBack()) {\n return;\n }\n store.assertIsReady();\n routingQueue.add({ type: 'GO_BACK' });\n}\n\nexport function canGoBack(): boolean {\n if (IS_DOM) {\n throw new Error(\n 'canGoBack imperative method is not supported. Pass the property to the DOM component instead.'\n );\n }\n // Return a default value here if the navigation hasn't mounted yet.\n // This can happen if the user calls `canGoBack` from the Root Layout route\n // before mounting a navigator. This behavior exists due to React Navigation being dynamically\n // constructed at runtime. We can get rid of this in the future if we use\n // the static configuration internally.\n if (!store.navigationRef.isReady()) {\n return false;\n }\n return store.navigationRef?.current?.canGoBack() ?? false;\n}\n\nexport function canDismiss(): boolean {\n if (IS_DOM) {\n throw new Error(\n 'canDismiss imperative method is not supported. Pass the property to the DOM component instead.'\n );\n }\n let state = store.state;\n\n // Keep traversing down the state tree until we find a stack navigator that we can pop\n while (state) {\n if (state.type === 'stack' && state.routes.length > 1) {\n return true;\n }\n if (state.index === undefined) return false;\n\n state = state.routes?.[state.index]?.state as any;\n }\n\n return false;\n}\n\nexport function setParams(\n params: Record<string, undefined | string | number | (string | number)[]> = {}\n) {\n if (emitDomSetParams(params)) {\n return;\n }\n store.assertIsReady();\n return (store.navigationRef?.current?.setParams as any)(params);\n}\n\nexport function linkTo(originalHref: Href, options: LinkToOptions = {}) {\n originalHref = typeof originalHref == 'string' ? originalHref : resolveHref(originalHref);\n let href: string | undefined | null = originalHref;\n\n if (emitDomLinkEvent(href, options)) {\n return;\n }\n\n if (shouldLinkExternally(href)) {\n if (href.startsWith('//') && Platform.OS !== 'web') {\n href = `https:${href}`;\n }\n\n Linking.openURL(href);\n return;\n }\n\n if (href === '..' || href === '../') {\n store.assertIsReady();\n const navigationRef = store.navigationRef.current;\n\n if (navigationRef == null) {\n throw new Error(\n \"Couldn't find a navigation object. Is your component inside NavigationContainer?\"\n );\n }\n\n if (!store.linking) {\n throw new Error('Attempted to link to route when no routes are present');\n }\n\n navigationRef.goBack();\n return;\n }\n\n const linkAction = {\n type: 'ROUTER_LINK' as const,\n payload: {\n href,\n options,\n },\n };\n\n routingQueue.add(linkAction);\n}\n\n/**\n * Returns `router` object for imperative navigation API.\n *\n * @example\n *```tsx\n * import { router } from 'expo-router';\n * import { Text } from 'react-native';\n *\n * export default function Route() {\n *\n * return (\n * <Text onPress={() => router.push('/home')}>Go Home</Text>\n * );\n *}\n * ```\n */\nexport type ImperativeRouter = {\n /**\n * Goes back in the navigation history.\n */\n back: () => void;\n /**\n * Navigates to a route in the navigator's history if it supports invoking the `back` function.\n */\n canGoBack: () => boolean;\n /**\n * Navigates to the provided [`href`](#href) using a push operation if possible.\n */\n push: (href: Href, options?: NavigationOptions) => void;\n /**\n * Navigates to the provided [`href`](#href).\n */\n navigate: (href: Href, options?: NavigationOptions) => void;\n /**\n * Navigates to route without appending to the history. Can be used with\n * [`useFocusEffect`](#usefocuseffecteffect-do_not_pass_a_second_prop)\n * to redirect imperatively to a new screen.\n *\n * @see [Using `useRouter()` hook](/router/reference/redirects/) to redirect.\n * */\n replace: (href: Href, options?: NavigationOptions) => void;\n /**\n * Navigates to the a stack lower than the current screen using the provided count if possible, otherwise 1.\n *\n * If the current screen is the only route, it will dismiss the entire stack.\n */\n dismiss: (count?: number) => void;\n /**\n * Dismisses screens until the provided href is reached. If the href is not found, it will instead replace the current screen with the provided `href`.\n */\n dismissTo: (href: Href, options?: NavigationOptions) => void;\n /**\n * Returns to the first screen of the closest stack — equivalent to a stack\n * `popToTop` action.\n *\n * @see React Navigation's [`popToTop`](https://reactnavigation.org/docs/stack-actions/#poptotop)\n * stack action for the underlying behavior.\n */\n dismissAll: () => void;\n /**\n * Checks if it is possible to dismiss the current screen. Returns `true` if the\n * router is within the stack with more than one screen in stack's history.\n *\n */\n canDismiss: () => boolean;\n /**\n * Updates the current route's query params.\n */\n setParams: <T extends RoutePath>(params: Partial<RouteInputParams<T>>) => void;\n /**\n * Reloads the currently mounted route in experimental server mode. This can be used to re-fetch data.\n * @hidden\n */\n reload: () => void;\n /**\n * Prefetch a screen in the background before navigating to it\n */\n prefetch: (name: Href) => void;\n};\n\n/**\n * @hidden\n */\nexport const router: ImperativeRouter = {\n navigate,\n push,\n dismiss,\n dismissAll,\n dismissTo,\n canDismiss,\n replace,\n back: () => goBack(),\n canGoBack,\n reload,\n prefetch,\n setParams: setParams as ImperativeRouter['setParams'],\n};\n"]}
@@ -1,7 +1,7 @@
1
1
  import type { NavigationState } from '../react-navigation/native';
2
2
  /**
3
- * Returns the [navigation state](https://reactnavigation.org/docs/navigation-state/)
4
- * of the navigator which contains the current screen.
3
+ * Returns the navigation state of the root navigator — the top-level navigator that
4
+ * contains the current screen.
5
5
  *
6
6
  * @example
7
7
  * ```tsx
@@ -13,6 +13,11 @@ import type { NavigationState } from '../react-navigation/native';
13
13
  * return <Text>{routes[0].name}</Text>;
14
14
  * }
15
15
  * ```
16
+ *
17
+ * @returns The current `NavigationState` of the root navigator.
18
+ *
19
+ * @see React Navigation's [navigation state](https://reactnavigation.org/docs/navigation-state/)
20
+ * reference for the shape of the returned object.
16
21
  */
17
22
  export declare function useRootNavigationState(): NavigationState;
18
23
  //# sourceMappingURL=useRootNavigationState.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useRootNavigationState.d.ts","sourceRoot":"","sources":["../../src/hooks/useRootNavigationState.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAkB,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAGlF;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,sBAAsB,IAAI,eAAe,CAWxD"}
1
+ {"version":3,"file":"useRootNavigationState.d.ts","sourceRoot":"","sources":["../../src/hooks/useRootNavigationState.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAkB,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAGlF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,sBAAsB,IAAI,eAAe,CAWxD"}
@@ -5,8 +5,8 @@ exports.useRootNavigationState = useRootNavigationState;
5
5
  const constants_1 = require("../constants");
6
6
  const native_1 = require("../react-navigation/native");
7
7
  /**
8
- * Returns the [navigation state](https://reactnavigation.org/docs/navigation-state/)
9
- * of the navigator which contains the current screen.
8
+ * Returns the navigation state of the root navigator — the top-level navigator that
9
+ * contains the current screen.
10
10
  *
11
11
  * @example
12
12
  * ```tsx
@@ -18,6 +18,11 @@ const native_1 = require("../react-navigation/native");
18
18
  * return <Text>{routes[0].name}</Text>;
19
19
  * }
20
20
  * ```
21
+ *
22
+ * @returns The current `NavigationState` of the root navigator.
23
+ *
24
+ * @see React Navigation's [navigation state](https://reactnavigation.org/docs/navigation-state/)
25
+ * reference for the shape of the returned object.
21
26
  */
22
27
  function useRootNavigationState() {
23
28
  const parent =
@@ -1 +1 @@
1
- {"version":3,"file":"useRootNavigationState.js","sourceRoot":"","sources":["../../src/hooks/useRootNavigationState.ts"],"names":[],"mappings":";AAAA,YAAY,CAAC;;AAqBb,wDAWC;AA9BD,4CAAkD;AAElD,uDAA2D;AAE3D;;;;;;;;;;;;;;GAcG;AACH,SAAgB,sBAAsB;IACpC,MAAM,MAAM;IACV,sDAAsD;IACtD,wFAAwF;IACxF,IAAA,sBAAa,GAAyC,CAAC,SAAS,CAAC,8BAAkB,CAAC,CAAC;IACvF,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CACb,gGAAgG,CACjG,CAAC;IACJ,CAAC;IACD,OAAO,MAAM,CAAC,QAAQ,EAAE,CAAC;AAC3B,CAAC","sourcesContent":["'use client';\n\nimport { INTERNAL_SLOT_NAME } from '../constants';\nimport type { NavigationProp, NavigationState } from '../react-navigation/native';\nimport { useNavigation } from '../react-navigation/native';\n\n/**\n * Returns the [navigation state](https://reactnavigation.org/docs/navigation-state/)\n * of the navigator which contains the current screen.\n *\n * @example\n * ```tsx\n * import { useRootNavigationState } from 'expo-router';\n *\n * export default function Route() {\n * const { routes } = useRootNavigationState();\n *\n * return <Text>{routes[0].name}</Text>;\n * }\n * ```\n */\nexport function useRootNavigationState(): NavigationState {\n const parent =\n // We assume that this is called from routes in __root\n // Users cannot customize the generated Sitemap or NotFound routes, so we should be safe\n useNavigation<NavigationProp<object, never, string>>().getParent(INTERNAL_SLOT_NAME);\n if (!parent) {\n throw new Error(\n 'useRootNavigationState was called from a generated route. This is likely a bug in Expo Router.'\n );\n }\n return parent.getState();\n}\n"]}
1
+ {"version":3,"file":"useRootNavigationState.js","sourceRoot":"","sources":["../../src/hooks/useRootNavigationState.ts"],"names":[],"mappings":";AAAA,YAAY,CAAC;;AA0Bb,wDAWC;AAnCD,4CAAkD;AAElD,uDAA2D;AAE3D;;;;;;;;;;;;;;;;;;;GAmBG;AACH,SAAgB,sBAAsB;IACpC,MAAM,MAAM;IACV,sDAAsD;IACtD,wFAAwF;IACxF,IAAA,sBAAa,GAAyC,CAAC,SAAS,CAAC,8BAAkB,CAAC,CAAC;IACvF,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CACb,gGAAgG,CACjG,CAAC;IACJ,CAAC;IACD,OAAO,MAAM,CAAC,QAAQ,EAAE,CAAC;AAC3B,CAAC","sourcesContent":["'use client';\n\nimport { INTERNAL_SLOT_NAME } from '../constants';\nimport type { NavigationProp, NavigationState } from '../react-navigation/native';\nimport { useNavigation } from '../react-navigation/native';\n\n/**\n * Returns the navigation state of the root navigator the top-level navigator that\n * contains the current screen.\n *\n * @example\n * ```tsx\n * import { useRootNavigationState } from 'expo-router';\n *\n * export default function Route() {\n * const { routes } = useRootNavigationState();\n *\n * return <Text>{routes[0].name}</Text>;\n * }\n * ```\n *\n * @returns The current `NavigationState` of the root navigator.\n *\n * @see React Navigation's [navigation state](https://reactnavigation.org/docs/navigation-state/)\n * reference for the shape of the returned object.\n */\nexport function useRootNavigationState(): NavigationState {\n const parent =\n // We assume that this is called from routes in __root\n // Users cannot customize the generated Sitemap or NotFound routes, so we should be safe\n useNavigation<NavigationProp<object, never, string>>().getParent(INTERNAL_SLOT_NAME);\n if (!parent) {\n throw new Error(\n 'useRootNavigationState was called from a generated route. This is likely a bug in Expo Router.'\n );\n }\n return parent.getState();\n}\n"]}
@@ -4,9 +4,12 @@
4
4
  export type EffectCallback = () => undefined | void | (() => void);
5
5
  /**
6
6
  * Hook to run an effect whenever a route is **focused**. Similar to
7
- * [`React.useEffect`](https://react.dev/reference/react/useEffect).
7
+ * [`React.useEffect`](https://react.dev/reference/react/useEffect), but the effect re-runs
8
+ * each time the screen comes into focus, and the optional cleanup function runs when the
9
+ * screen loses focus — not on unmount. This makes it the right primitive for refetching
10
+ * data, restarting subscriptions, or resetting transient screen state every time a user
11
+ * returns to the route.
8
12
  *
9
- * This can be used to perform side-effects such as fetching data or subscribing to events.
10
13
  * The passed callback should be wrapped in [`React.useCallback`](https://react.dev/reference/react/useCallback)
11
14
  * to avoid running the effect too often.
12
15
  *
@@ -1 +1 @@
1
- {"version":3,"file":"useFocusEffect.d.ts","sourceRoot":"","sources":["../src/useFocusEffect.ts"],"names":[],"mappings":"AAQA;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,MAAM,IAAI,CAAC,CAAC;AAEnE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,cAAc,EAAE,yBAAyB,CAAC,EAAE,KAAK,QAuGvF"}
1
+ {"version":3,"file":"useFocusEffect.d.ts","sourceRoot":"","sources":["../src/useFocusEffect.ts"],"names":[],"mappings":"AAQA;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,MAAM,IAAI,CAAC,CAAC;AAEnE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,cAAc,EAAE,yBAAyB,CAAC,EAAE,KAAK,QAuGvF"}
@@ -42,9 +42,12 @@ const useLoadedNavigation_1 = require("./link/useLoadedNavigation");
42
42
  const useNavigation_1 = require("./useNavigation");
43
43
  /**
44
44
  * Hook to run an effect whenever a route is **focused**. Similar to
45
- * [`React.useEffect`](https://react.dev/reference/react/useEffect).
45
+ * [`React.useEffect`](https://react.dev/reference/react/useEffect), but the effect re-runs
46
+ * each time the screen comes into focus, and the optional cleanup function runs when the
47
+ * screen loses focus — not on unmount. This makes it the right primitive for refetching
48
+ * data, restarting subscriptions, or resetting transient screen state every time a user
49
+ * returns to the route.
46
50
  *
47
- * This can be used to perform side-effects such as fetching data or subscribing to events.
48
51
  * The passed callback should be wrapped in [`React.useCallback`](https://react.dev/reference/react/useCallback)
49
52
  * to avoid running the effect too often.
50
53
  *
@@ -85,7 +88,7 @@ function useFocusEffect(effect, do_not_pass_a_second_prop) {
85
88
  ' // Your code here\n' +
86
89
  ' }, [depA, depB])\n' +
87
90
  ');\n\n' +
88
- 'See usage guide: https://reactnavigation.org/docs/use-focus-effect';
91
+ 'See usage guide: https://docs.expo.dev/versions/latest/sdk/router/#usefocuseffecteffect-do_not_pass_a_second_prop';
89
92
  console.error(message);
90
93
  }
91
94
  React.useEffect(() => {
@@ -120,7 +123,7 @@ function useFocusEffect(effect, do_not_pass_a_second_prop) {
120
123
  ' fetchData();\n' +
121
124
  ' }, [someId])\n' +
122
125
  ');\n\n' +
123
- 'See usage guide: https://reactnavigation.org/docs/use-focus-effect';
126
+ 'See usage guide: https://docs.expo.dev/versions/latest/sdk/router/#usefocuseffecteffect-do_not_pass_a_second_prop';
124
127
  }
125
128
  else {
126
129
  message += ` You returned '${JSON.stringify(destroy)}'.`;
@@ -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,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CAAC;qBAAM,CAAC;oBACN,OAAO,IAAI,kBAAkB,IAAI,CAAC,SAAS,CAAC,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,CAAC,CAAC,CAAC;AAC/C,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]);\n}\n"]}
1
+ {"version":3,"file":"useFocusEffect.js","sourceRoot":"","sources":["../src/useFocusEffect.ts"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkDb,wCAuGC;AAxJD,gFAAgF;AAChF,sEAAsE;AACtE,6CAA+B;AAE/B,oEAAmE;AACnE,mDAAgD;AAOhD;;;;;;;;;;;;;;;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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), but the effect re-runs\n * each time the screen comes into focus, and the optional cleanup function runs when the\n * screen loses focus — not on unmount. This makes it the right primitive for refetching\n * data, restarting subscriptions, or resetting transient screen state every time a user\n * returns to the route.\n *\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://docs.expo.dev/versions/latest/sdk/router/#usefocuseffecteffect-do_not_pass_a_second_prop';\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://docs.expo.dev/versions/latest/sdk/router/#usefocuseffecteffect-do_not_pass_a_second_prop';\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"]}
@@ -1,8 +1,9 @@
1
1
  import type { NavigationProp, NavigationState } from './react-navigation/native';
2
2
  import type { Href } from './types';
3
3
  /**
4
- * Returns the underlying React Navigation [`navigation` object](https://reactnavigation.org/docs/navigation-object)
5
- * to imperatively access layout-specific functionality like `navigation.openDrawer()` in a
4
+ * Returns the navigation object for the current route. Mirrors the React Navigation
5
+ * [`navigation` object](https://reactnavigation.org/docs/navigation-object). Use it to
6
+ * imperatively access layout-specific functionality like `navigation.openDrawer()` in a
6
7
  * [Drawer](/router/advanced/drawer/) layout.
7
8
  *
8
9
  * @example
@@ -49,8 +50,9 @@ import type { Href } from './types';
49
50
  * @param parent Provide an absolute path such as `/(root)` to the parent route or a relative path like `../../` to the parent route.
50
51
  * @returns The navigation object for the current route.
51
52
  *
52
- * @see React Navigation documentation on [navigation dependent functions](https://reactnavigation.org/docs/navigation-object/#navigator-dependent-functions)
53
- * for more information.
53
+ * @see The full navigation API is available directly from `expo-router` — no
54
+ * `@react-navigation/*` install required. For the navigator-dependent functions reference,
55
+ * see [navigation dependent functions](https://reactnavigation.org/docs/navigation-object/#navigator-dependent-functions).
54
56
  */
55
57
  export declare function useNavigation<T = Omit<NavigationProp<ReactNavigation.RootParamList>, 'getState'> & {
56
58
  getState(): NavigationState | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"useNavigation.d.ts","sourceRoot":"","sources":["../src/useNavigation.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAEjF,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAEpC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AACH,wBAAgB,aAAa,CAC3B,CAAC,GAAG,IAAI,CAAC,cAAc,CAAC,eAAe,CAAC,aAAa,CAAC,EAAE,UAAU,CAAC,GAAG;IACpE,QAAQ,IAAI,eAAe,GAAG,SAAS,CAAC;CACzC,EACD,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,CAAC,CAoF3B"}
1
+ {"version":3,"file":"useNavigation.d.ts","sourceRoot":"","sources":["../src/useNavigation.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAEjF,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAEpC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AACH,wBAAgB,aAAa,CAC3B,CAAC,GAAG,IAAI,CAAC,cAAc,CAAC,eAAe,CAAC,aAAa,CAAC,EAAE,UAAU,CAAC,GAAG;IACpE,QAAQ,IAAI,eAAe,GAAG,SAAS,CAAC;CACzC,EACD,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,CAAC,CAoF3B"}
@@ -6,8 +6,9 @@ const utils_1 = require("./global-state/utils");
6
6
  const href_1 = require("./link/href");
7
7
  const native_1 = require("./react-navigation/native");
8
8
  /**
9
- * Returns the underlying React Navigation [`navigation` object](https://reactnavigation.org/docs/navigation-object)
10
- * to imperatively access layout-specific functionality like `navigation.openDrawer()` in a
9
+ * Returns the navigation object for the current route. Mirrors the React Navigation
10
+ * [`navigation` object](https://reactnavigation.org/docs/navigation-object). Use it to
11
+ * imperatively access layout-specific functionality like `navigation.openDrawer()` in a
11
12
  * [Drawer](/router/advanced/drawer/) layout.
12
13
  *
13
14
  * @example
@@ -54,8 +55,9 @@ const native_1 = require("./react-navigation/native");
54
55
  * @param parent Provide an absolute path such as `/(root)` to the parent route or a relative path like `../../` to the parent route.
55
56
  * @returns The navigation object for the current route.
56
57
  *
57
- * @see React Navigation documentation on [navigation dependent functions](https://reactnavigation.org/docs/navigation-object/#navigator-dependent-functions)
58
- * for more information.
58
+ * @see The full navigation API is available directly from `expo-router` — no
59
+ * `@react-navigation/*` install required. For the navigator-dependent functions reference,
60
+ * see [navigation dependent functions](https://reactnavigation.org/docs/navigation-object/#navigator-dependent-functions).
59
61
  */
60
62
  function useNavigation(parent) {
61
63
  const rnNavigation = (0, native_1.useNavigation)();
@@ -1 +1 @@
1
- {"version":3,"file":"useNavigation.js","sourceRoot":"","sources":["../src/useNavigation.ts"],"names":[],"mappings":";AAAA,YAAY,CAAC;;AA4Db,sCAwFC;AAlJD,gDAA8D;AAC9D,sCAA0C;AAE1C,sDAAoG;AAGpG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AACH,SAAgB,aAAa,CAI3B,MAAsB;IACtB,MAAM,YAAY,GAAG,IAAA,sBAAqB,GAAO,CAAC;IAClD,IAAI,UAAU,GAAG,YAAY,CAAC;IAC9B,IAAI,KAAK,GAAG,IAAA,wBAAe,GAAE,CAAC;IAE9B,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACzB,iEAAiE;QACjE,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,uEAAuE;IACvE,MAAM,SAAS,GAAG,UAAU,CAAC,KAAK,EAAE,CAAC;IACrC,IAAI,SAAS,KAAK,EAAE,IAAI,SAAS,KAAK,oCAAoC,EAAE,CAAC;QAC3E,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;QAC/B,MAAM,GAAG,IAAA,kBAAW,EAAC,MAAM,CAAC,CAAC;IAC/B,CAAC;IAED,IAAI,MAAM,KAAK,GAAG,EAAE,CAAC;QACnB,6BAA6B;QAC7B,OAAO,UAAU,CAAC,SAAS,CAAC,oCAAoC,CAAC,IAAI,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;IAChG,CAAC;SAAM,IAAI,MAAM,EAAE,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC;QACrC,MAAM,KAAK,GAAa,EAAE,CAAC;QAE3B,OAAO,KAAK,EAAE,CAAC;YACb,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,C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AY,EAAE,CAAC;QAC1C,IAAI,CAAC,UAAU,EAAE,CAAC;YAChB,UAAU,GAAG,YAAY,CAAC;YAC1B,MAAM,GAAG,GAA2B,EAAE,CAAC;YACvC,OAAO,UAAU,EAAE,CAAC;gBAClB,IAAI,UAAU,CAAC,KAAK,EAAE;oBAAE,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC,CAAC;gBACrD,UAAU,GAAG,UAAU,CAAC,SAAS,EAAE,CAAC;YACtC,CAAC;YAED,MAAM,IAAI,KAAK,CACb,gDAAgD,MAAM,6BAA6B,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CACvG,CAAC;QACJ,CAAC;IACH,CAAC;IAED,OAAO,UAAU,CAAC;AACpB,CAAC","sourcesContent":["'use client';\n\nimport { getRootStackRouteNames } from './global-state/utils';\nimport { resolveHref } from './link/href';\nimport type { NavigationProp, NavigationState } from './react-navigation/native';\nimport { useNavigation as useUpstreamNavigation, useStateForPath } from './react-navigation/native';\nimport type { Href } from './types';\n\n/**\n * Returns the underlying React Navigation [`navigation` object](https://reactnavigation.org/docs/navigation-object)\n * to imperatively access layout-specific functionality like `navigation.openDrawer()` in a\n * [Drawer](/router/advanced/drawer/) layout.\n *\n * @example\n * ```tsx app/index.tsx\n * import { useNavigation } from 'expo-router';\n *\n * export default function Route() {\n * // Access the current navigation object for the current route.\n * const navigation = useNavigation();\n *\n * return (\n * <View>\n * <Text onPress={() => {\n * // Open the drawer view.\n * navigation.openDrawer();\n * }}>\n * Open Drawer\n * </Text>\n * </View>\n * );\n * }\n * ```\n *\n * When using nested layouts, you can access higher-order layouts by passing a secondary argument denoting the layout route.\n * For example, `/menu/_layout.tsx` is nested inside `/app/orders/`, you can use `useNavigation('/orders/menu/')`.\n *\n * @example\n * ```tsx app/orders/menu/index.tsx\n * import { useNavigation } from 'expo-router';\n *\n * export default function MenuRoute() {\n * const rootLayout = useNavigation('/');\n * const ordersLayout = useNavigation('/orders');\n *\n * // Same as the default results of `useNavigation()` when invoked in this route.\n * const parentLayout = useNavigation('/orders/menu');\n * }\n * ```\n *\n * If you attempt to access a layout that doesn't exist, an error such as\n * `Could not find parent navigation with route \"/non-existent\"` is thrown.\n *\n *\n * @param parent Provide an absolute path such as `/(root)` to the parent route or a relative path like `../../` to the parent route.\n * @returns The navigation object for the current route.\n *\n * @see React Navigation documentation on [navigation dependent functions](https://reactnavigation.org/docs/navigation-object/#navigator-dependent-functions)\n * for more information.\n */\nexport function useNavigation<\n T = Omit<NavigationProp<ReactNavigation.RootParamList>, 'getState'> & {\n getState(): NavigationState | undefined;\n },\n>(parent?: string | Href): T {\n const rnNavigation = useUpstreamNavigation<any>();\n let navigation = rnNavigation;\n let state = useStateForPath();\n\n if (parent === undefined) {\n // If no parent is provided, return the current navigation object\n return navigation;\n }\n\n // Check for the top-level navigator - we cannot fetch anything higher!\n const currentId = navigation.getId();\n if (currentId === '' || currentId === `/expo-router/build/views/Navigator`) {\n return navigation;\n }\n\n if (typeof parent === 'object') {\n parent = resolveHref(parent);\n }\n\n if (parent === '/') {\n // This is the root navigator\n return navigation.getParent(`/expo-router/build/views/Navigator`) ?? navigation.getParent(``);\n } else if (parent?.startsWith('../')) {\n const names: string[] = [];\n\n while (state) {\n const route = state.routes[0];\n state = route.state;\n // Don't include the last router, as thats the current route\n if (state) {\n names.push(route.name);\n }\n }\n\n // Removing the trailing slash to make splitting easier\n const originalParent = parent;\n if (parent.endsWith('/')) {\n parent = parent.slice(0, -1);\n }\n\n const segments = parent.split('/');\n if (!segments.every((segment) => segment === '..')) {\n throw new Error(\n `Invalid parent path \"${originalParent}\". Only \"../\" segments are allowed when using relative paths.`\n );\n }\n\n const levels = segments.length;\n const index = names.length - 1 - levels;\n\n if (index < 0) {\n throw new Error(\n `Invalid parent path \"${originalParent}\". Cannot go up ${levels} levels from the current route.`\n );\n }\n\n parent = names[index];\n\n // Expo Router navigators use the context key as the name which has a leading `/`\n // The exception to this are the root stack routes, and the root navigator which uses ''\n if (parent && !getRootStackRouteNames().includes(parent)) {\n parent = `/${parent}`;\n }\n }\n\n navigation = navigation.getParent(parent);\n\n if (process.env.NODE_ENV !== 'production') {\n if (!navigation) {\n navigation = rnNavigation;\n const ids: (string | undefined)[] = [];\n while (navigation) {\n if (navigation.getId()) ids.push(navigation.getId());\n navigation = navigation.getParent();\n }\n\n throw new Error(\n `Could not find parent navigation with route \"${parent}\". Available routes are: '${ids.join(\"', '\")}'`\n );\n }\n }\n\n return navigation;\n}\n"]}
1
+ {"version":3,"file":"useNavigation.js","sourceRoot":"","sources":["../src/useNavigation.ts"],"names":[],"mappings":";AAAA,YAAY,CAAC;;AA8Db,sCAwFC;AApJD,gDAA8D;AAC9D,sCAA0C;AAE1C,sDAAoG;AAGpG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AACH,SAAgB,aAAa,CAI3B,MAAsB;IACtB,MAAM,YAAY,GAAG,IAAA,sBAAqB,GAAO,CAAC;IAClD,IAAI,UAAU,GAAG,YAAY,CAAC;IAC9B,IAAI,KAAK,GAAG,IAAA,wBAAe,GAAE,CAAC;IAE9B,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACzB,iEAAiE;QACjE,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,uEAAuE;IACvE,MAAM,SAAS,GAAG,UAAU,CAAC,KAAK,EAAE,CAAC;IACrC,IAAI,SAAS,KAAK,EAAE,IAAI,SAAS,KAAK,oCAAoC,EAAE,CAAC;QAC3E,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;QAC/B,MAAM,GAAG,IAAA,kBAAW,EAAC,MAAM,CAAC,CAAC;IAC/B,CAAC;IAED,IAAI,MAAM,KAAK,GAAG,EAAE,CAAC;QACnB,6BAA6B;QAC7B,OAAO,UAAU,CAAC,SAAS,CAAC,oCAAoC,CAAC,IAAI,UAAU,CAAC,SAAS,CA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,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;YACzD,MAAM,GAAG,IAAI,MAAM,EAAE,CAAC;QACxB,CAAC;IACH,CAAC;IAED,UAAU,GAAG,UAAU,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IAE1C,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,EAAE,CAAC;QAC1C,IAAI,CAAC,UAAU,EAAE,CAAC;YAChB,UAAU,GAAG,YAAY,CAAC;YAC1B,MAAM,GAAG,GAA2B,EAAE,CAAC;YACvC,OAAO,UAAU,EAAE,CAAC;gBAClB,IAAI,UAAU,CAAC,KAAK,EAAE;oBAAE,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC,CAAC;gBACrD,UAAU,GAAG,UAAU,CAAC,SAAS,EAAE,CAAC;YACtC,CAAC;YAED,MAAM,IAAI,KAAK,CACb,gDAAgD,MAAM,6BAA6B,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CACvG,CAAC;QACJ,CAAC;IACH,CAAC;IAED,OAAO,UAAU,CAAC;AACpB,CAAC","sourcesContent":["'use client';\n\nimport { getRootStackRouteNames } from './global-state/utils';\nimport { resolveHref } from './link/href';\nimport type { NavigationProp, NavigationState } from './react-navigation/native';\nimport { useNavigation as useUpstreamNavigation, useStateForPath } from './react-navigation/native';\nimport type { Href } from './types';\n\n/**\n * Returns the navigation object for the current route. Mirrors the React Navigation\n * [`navigation` object](https://reactnavigation.org/docs/navigation-object). Use it to\n * imperatively access layout-specific functionality like `navigation.openDrawer()` in a\n * [Drawer](/router/advanced/drawer/) layout.\n *\n * @example\n * ```tsx app/index.tsx\n * import { useNavigation } from 'expo-router';\n *\n * export default function Route() {\n * // Access the current navigation object for the current route.\n * const navigation = useNavigation();\n *\n * return (\n * <View>\n * <Text onPress={() => {\n * // Open the drawer view.\n * navigation.openDrawer();\n * }}>\n * Open Drawer\n * </Text>\n * </View>\n * );\n * }\n * ```\n *\n * When using nested layouts, you can access higher-order layouts by passing a secondary argument denoting the layout route.\n * For example, `/menu/_layout.tsx` is nested inside `/app/orders/`, you can use `useNavigation('/orders/menu/')`.\n *\n * @example\n * ```tsx app/orders/menu/index.tsx\n * import { useNavigation } from 'expo-router';\n *\n * export default function MenuRoute() {\n * const rootLayout = useNavigation('/');\n * const ordersLayout = useNavigation('/orders');\n *\n * // Same as the default results of `useNavigation()` when invoked in this route.\n * const parentLayout = useNavigation('/orders/menu');\n * }\n * ```\n *\n * If you attempt to access a layout that doesn't exist, an error such as\n * `Could not find parent navigation with route \"/non-existent\"` is thrown.\n *\n *\n * @param parent Provide an absolute path such as `/(root)` to the parent route or a relative path like `../../` to the parent route.\n * @returns The navigation object for the current route.\n *\n * @see The full navigation API is available directly from `expo-router` — no\n * `@react-navigation/*` install required. For the navigator-dependent functions reference,\n * see [navigation dependent functions](https://reactnavigation.org/docs/navigation-object/#navigator-dependent-functions).\n */\nexport function useNavigation<\n T = Omit<NavigationProp<ReactNavigation.RootParamList>, 'getState'> & {\n getState(): NavigationState | undefined;\n },\n>(parent?: string | Href): T {\n const rnNavigation = useUpstreamNavigation<any>();\n let navigation = rnNavigation;\n let state = useStateForPath();\n\n if (parent === undefined) {\n // If no parent is provided, return the current navigation object\n return navigation;\n }\n\n // Check for the top-level navigator - we cannot fetch anything higher!\n const currentId = navigation.getId();\n if (currentId === '' || currentId === `/expo-router/build/views/Navigator`) {\n return navigation;\n }\n\n if (typeof parent === 'object') {\n parent = resolveHref(parent);\n }\n\n if (parent === '/') {\n // This is the root navigator\n return navigation.getParent(`/expo-router/build/views/Navigator`) ?? navigation.getParent(``);\n } else if (parent?.startsWith('../')) {\n const names: string[] = [];\n\n while (state) {\n const route = state.routes[0];\n state = route.state;\n // Don't include the last router, as thats the current route\n if (state) {\n names.push(route.name);\n }\n }\n\n // Removing the trailing slash to make splitting easier\n const originalParent = parent;\n if (parent.endsWith('/')) {\n parent = parent.slice(0, -1);\n }\n\n const segments = parent.split('/');\n if (!segments.every((segment) => segment === '..')) {\n throw new Error(\n `Invalid parent path \"${originalParent}\". Only \"../\" segments are allowed when using relative paths.`\n );\n }\n\n const levels = segments.length;\n const index = names.length - 1 - levels;\n\n if (index < 0) {\n throw new Error(\n `Invalid parent path \"${originalParent}\". Cannot go up ${levels} levels from the current route.`\n );\n }\n\n parent = names[index];\n\n // Expo Router navigators use the context key as the name which has a leading `/`\n // The exception to this are the root stack routes, and the root navigator which uses ''\n if (parent && !getRootStackRouteNames().includes(parent)) {\n parent = `/${parent}`;\n }\n }\n\n navigation = navigation.getParent(parent);\n\n if (process.env.NODE_ENV !== 'production') {\n if (!navigation) {\n navigation = rnNavigation;\n const ids: (string | undefined)[] = [];\n while (navigation) {\n if (navigation.getId()) ids.push(navigation.getId());\n navigation = navigation.getParent();\n }\n\n throw new Error(\n `Could not find parent navigation with route \"${parent}\". Available routes are: '${ids.join(\"', '\")}'`\n );\n }\n }\n\n return navigation;\n}\n"]}
@@ -9,7 +9,7 @@
9
9
  "publication": {
10
10
  "groupId": "expo.modules.router",
11
11
  "artifactId": "expo.modules.router",
12
- "version": "56.2.3",
12
+ "version": "56.2.4",
13
13
  "repository": "local-maven-repo"
14
14
  }
15
15
  }
@@ -3,7 +3,7 @@
3
3
  "component": {
4
4
  "group": "expo.modules.router",
5
5
  "module": "expo.modules.router",
6
- "version": "56.2.3",
6
+ "version": "56.2.4",
7
7
  "attributes": {
8
8
  "org.gradle.status": "release"
9
9
  }
@@ -24,8 +24,8 @@
24
24
  },
25
25
  "files": [
26
26
  {
27
- "name": "expo.modules.router-56.2.3.aar",
28
- "url": "expo.modules.router-56.2.3.aar",
27
+ "name": "expo.modules.router-56.2.4.aar",
28
+ "url": "expo.modules.router-56.2.4.aar",
29
29
  "size": 15835,
30
30
  "sha512": "72b5be73401c4b0a8807373f01bd79e202212f07713d071019c24eb27227a4c8568d6148d0a48338f6955f9dbe713f56e7877d8e3fe0acec28dbb68533953d90",
31
31
  "sha256": "7c41d508ab24d199ead0eb06525957cdd227a73925863865bf2956d48cb707ef",
@@ -74,8 +74,8 @@
74
74
  ],
75
75
  "files": [
76
76
  {
77
- "name": "expo.modules.router-56.2.3.aar",
78
- "url": "expo.modules.router-56.2.3.aar",
77
+ "name": "expo.modules.router-56.2.4.aar",
78
+ "url": "expo.modules.router-56.2.4.aar",
79
79
  "size": 15835,
80
80
  "sha512": "72b5be73401c4b0a8807373f01bd79e202212f07713d071019c24eb27227a4c8568d6148d0a48338f6955f9dbe713f56e7877d8e3fe0acec28dbb68533953d90",
81
81
  "sha256": "7c41d508ab24d199ead0eb06525957cdd227a73925863865bf2956d48cb707ef",
@@ -94,8 +94,8 @@
94
94
  },
95
95
  "files": [
96
96
  {
97
- "name": "expo.modules.router-56.2.3-sources.jar",
98
- "url": "expo.modules.router-56.2.3-sources.jar",
97
+ "name": "expo.modules.router-56.2.4-sources.jar",
98
+ "url": "expo.modules.router-56.2.4-sources.jar",
99
99
  "size": 2326,
100
100
  "sha512": "a1a1537b57bc0d66efbf2bdfd5f514684400b9598e549eaf53c528d1bf32ff42b7826e74fb6e115f8ec0490b9e06ffbb3c3efe9f2f703652c13291ef82b0fa03",
101
101
  "sha256": "2add0f802e663eb9b5f90e086dca0e0e337a1442e15fb372a05945e01ee0d289",
@@ -0,0 +1 @@
1
+ acb0a38295215971e8e2e97a3ad092ac431738c950455dd90565f78928205dd2
@@ -0,0 +1 @@
1
+ b643367a4ff20b8a3fd5d1f8ee6158ae4d0a7e8249096aef33f1e3925058f03dbfb5a829d554f7489fa0f01c74ab6caf07b69f87821eeb587d7aaca14e4a9bd3
@@ -9,7 +9,7 @@
9
9
  <modelVersion>4.0.0</modelVersion>
10
10
  <groupId>expo.modules.router</groupId>
11
11
  <artifactId>expo.modules.router</artifactId>
12
- <version>56.2.3</version>
12
+ <version>56.2.4</version>
13
13
  <packaging>aar</packaging>
14
14
  <name>expo.modules.router</name>
15
15
  <url>https://github.com/expo/expo</url>
@@ -0,0 +1 @@
1
+ 3285697118ad41e03a426f2e2f5a75fb8a971bcad57a97df1ef7fddb1f1a47c8
@@ -0,0 +1 @@
1
+ 668f26e59ee91f42641b10d15af1f957dce428dd24ca463b0864f79b02293f019b48e5f5238f9fe48deb8ad007e3bc2cbbc5c09524f28ac42b7d4b64db89323c
@@ -3,11 +3,11 @@
3
3
  <groupId>expo.modules.router</groupId>
4
4
  <artifactId>expo.modules.router</artifactId>
5
5
  <versioning>
6
- <latest>56.2.3</latest>
7
- <release>56.2.3</release>
6
+ <latest>56.2.4</latest>
7
+ <release>56.2.4</release>
8
8
  <versions>
9
- <version>56.2.3</version>
9
+ <version>56.2.4</version>
10
10
  </versions>
11
- <lastUpdated>20260520215031</lastUpdated>
11
+ <lastUpdated>20260521101341</lastUpdated>
12
12
  </versioning>
13
13
  </metadata>
@@ -1 +1 @@
1
- 62b401c02ddc823b5a382f40222402d4
1
+ b96a6a13d97122de329a75452154f6aa
@@ -1 +1 @@
1
- 25666b83354f2a868354570453b6fd457f19a120
1
+ 38e606ce70b7aa8b888b3b6c75d0695d17fb1789
@@ -1 +1 @@
1
- ba078c533c506d8e297a0be8f94d89a21d014c7ba547b89c6d20d05771f1184a
1
+ 87e750296572b5ac7bb6216cbdb6790c4741dd495c356007eb6bb9bb657058dd
@@ -1 +1 @@
1
- 66c19763bb9ed620455dac01883031649d1a2fd9e46bbbbd329dbe87eaa93d3cc802ea6d6a054f0f35ccc1ee218a05e7fee7d15c974bf34b78286a8d343b295e
1
+ 8b8a3910ca0caaac8fc545706f868fc26388d1745acac58c65574a777f46852d67ccf7fd4565ca4f74feed3d4cecb32a119938421043bc310685de1b43b2e4ea
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-router",
3
- "version": "56.2.3",
3
+ "version": "56.2.4",
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",
@@ -136,7 +136,7 @@
136
136
  "react-native-web": "~0.21.0",
137
137
  "react-server-dom-webpack": "~19.0.6",
138
138
  "tsd": "^0.33.0",
139
- "expo": "56.0.0"
139
+ "expo": "56.0.2"
140
140
  },
141
141
  "dependencies": {
142
142
  "@expo/log-box": "^56.0.12",
@@ -168,7 +168,7 @@
168
168
  "shallowequal": "^1.1.0",
169
169
  "vaul": "^1.1.2"
170
170
  },
171
- "gitHead": "c4c9867a0bcbb188e55ecaec4998e38d33108a5d",
171
+ "gitHead": "2e3e8a28ea97a8b9e3faa6b9ccae51d2e91a30e2",
172
172
  "scripts": {
173
173
  "build": "node ./scripts/build.js",
174
174
  "clean": "expo-module clean",
@@ -1 +1 @@
1
- {"root":["./src/index.ts","./src/withrouter.ts"],"version":"6.0.3"}
1
+ {"root":["./src/index.ts","./src/withrouter.ts"],"version":"5.9.3"}
@@ -1 +0,0 @@
1
- 8ecae7c8126e283c956d4bd608af6333e6da107f23e501c494108cc6de782713
@@ -1 +0,0 @@
1
- 765ea4c5cc43bad6027967fc138fb5f143f3a27adf8b6f08f19c1717f5dba2ad2628fdb50f393c72b5eef6de8f43b414113132427ae6e0826ed10a536117fc10
@@ -1 +0,0 @@
1
- 009adb6daca3268bd9eb4fe4da184a5f05767791972d4fe0f0b347a4963da83d
@@ -1 +0,0 @@
1
- 5b006184e5e968586c389977c4028087c25d5015f6a769ddd30fe0c937e5f9886d63da1a49f9a6991d63796ba6033af64733ac27a03fa34b50a91350345dd941