{"ast":null,"code":"\"use strict\";\n\nimport { NavigationContainerRefContext } from '@react-navigation/core';\nimport * as React from 'react';\nimport { useLinkBuilder } from \"./useLinkBuilder.js\";\nexport function useLinkTo() {\n  const navigation = React.useContext(NavigationContainerRefContext);\n  const {\n    buildAction\n  } = useLinkBuilder();\n  const linkTo = React.useCallback(href => {\n    if (navigation === undefined) {\n      throw new Error(\"Couldn't find a navigation object. Is your component inside NavigationContainer?\");\n    }\n    const action = buildAction(href);\n    navigation.dispatch(action);\n  }, [buildAction, navigation]);\n  return linkTo;\n}","map":{"version":3,"names":["NavigationContainerRefContext","React","useLinkBuilder","useLinkTo","navigation","useContext","buildAction","linkTo","useCallback","href","undefined","Error","action","dispatch"],"sources":["/Users/pmouli/Documents/GitHub.nosync/boots-strapper/mobile/node_modules/@react-navigation/native/src/useLinkTo.tsx"],"sourcesContent":["import { NavigationContainerRefContext } from '@react-navigation/core';\nimport * as React from 'react';\n\nimport { useLinkBuilder } from './useLinkBuilder';\n\n/**\n * Helper to navigate to a screen using a href based on the linking options.\n *\n * @returns function that receives the href to navigate to.\n */\nexport function useLinkTo() {\n  const navigation = React.useContext(NavigationContainerRefContext);\n  const { buildAction } = useLinkBuilder();\n\n  const linkTo = React.useCallback(\n    (href: string) => {\n      if (navigation === undefined) {\n        throw new Error(\n          \"Couldn't find a navigation object. Is your component inside NavigationContainer?\"\n        );\n      }\n\n      const action = buildAction(href);\n\n      navigation.dispatch(action);\n    },\n    [buildAction, navigation]\n  );\n\n  return linkTo;\n}\n"],"mappings":";;AAAA,SAASA,6BAA6B,QAAQ,wBAAwB;AACtE,OAAO,KAAKC,KAAK,MAAM,OAAO;AAE9B,SAASC,cAAc;AAOvB,OAAO,SAASC,SAASA,CAAA,EAAG;EAC1B,MAAMC,UAAU,GAAGH,KAAK,CAACI,UAAU,CAACL,6BAA6B,CAAC;EAClE,MAAM;IAAEM;EAAY,CAAC,GAAGJ,cAAc,CAAC,CAAC;EAExC,MAAMK,MAAM,GAAGN,KAAK,CAACO,WAAW,CAC7BC,IAAY,IAAK;IAChB,IAAIL,UAAU,KAAKM,SAAS,EAAE;MAC5B,MAAM,IAAIC,KAAK,CACb,kFACF,CAAC;IACH;IAEA,MAAMC,MAAM,GAAGN,WAAW,CAACG,IAAI,CAAC;IAEhCL,UAAU,CAACS,QAAQ,CAACD,MAAM,CAAC;EAC7B,CAAC,EACD,CAACN,WAAW,EAAEF,UAAU,CAC1B,CAAC;EAED,OAAOG,MAAM;AACf","ignoreList":[]},"metadata":{"hasCjsExports":false},"sourceType":"module","externalDependencies":[]}