{"version":3,"file":"useRouter.js","sources":["../../src/useRouter.tsx"],"sourcesContent":["import * as React from 'react'\nimport warning from 'tiny-warning'\nimport { getRouterContext } from './routerContext'\nimport type { AnyRouter, RegisteredRouter } from '@tanstack/router-core'\n\nexport function useRouter(opts?: {\n warn?: boolean\n}): TRouter {\n const value = React.useContext(getRouterContext())\n warning(\n !((opts?.warn ?? true) && !value),\n 'useRouter must be used inside a component!',\n )\n return value as any\n}\n"],"names":[],"mappings":";;;AAKO,SAAS,UAAwD,MAE5D;AACV,QAAM,QAAQ,MAAM,WAAW,iBAAA,CAAkB;AACjD;AAAA,IACE,IAAG,6BAAM,SAAQ,SAAS,CAAC;AAAA,IAC3B;AAAA,EACF;AACO,SAAA;AACT;"}