You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 line
1.3 KiB
1 line
1.3 KiB
{"ast":null,"code":"import * as React from 'react';\nimport NavigationRouteContext from \"./NavigationRouteContext\";\nexport default function useRoute() {\n var route = React.useContext(NavigationRouteContext);\n if (route === undefined) {\n throw new Error(\"Couldn't find a route object. Is your component inside a screen in a navigator?\");\n }\n return route;\n}","map":{"version":3,"sources":["useRoute.tsx"],"names":["React","NavigationRouteContext","useRoute","route","useContext","undefined","Error"],"mappings":"AACA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAE9B,OAAOC,sBAAsB;AAQ7B,eAAe,SAASC,QAAQ,GAA0C;EACxE,IAAMC,KAAK,GAAGH,KAAK,CAACI,UAAU,CAACH,sBAAsB,CAAC;EAEtD,IAAIE,KAAK,KAAKE,SAAS,EAAE;IACvB,MAAM,IAAIC,KAAK,CACb,iFAAiF,CAClF;EACH;EAEA,OAAOH,KAAK;AACd","sourceRoot":"../../src","sourcesContent":["import * as React from 'react';\nimport NavigationRouteContext from './NavigationRouteContext';\n/**\n * Hook to access the route prop of the parent screen anywhere.\n *\n * @returns Route prop of the parent screen.\n */\nexport default function useRoute() {\n const route = React.useContext(NavigationRouteContext);\n if (route === undefined) {\n throw new Error(\"Couldn't find a route object. Is your component inside a screen in a navigator?\");\n }\n return route;\n}\n//# sourceMappingURL=useRoute.js.map"]},"metadata":{},"sourceType":"module"} |