Files
med-notes/.pnpm-store/v10/files/26/6d92b513d982e45e3e975339c779407399a0e903f35129ad7a0e368d92eb3577af57249874aebc4f341027dc17321088966f58e41d18dc0ce25f95742696c8
2025-05-09 05:30:08 +02:00

1 line
776 B
Plaintext

{"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<TRouter extends AnyRouter = RegisteredRouter>(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 <RouterProvider> 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;"}