med-notes/.pnpm-store/v10/files/9a/91f1335ae37f1159ecb128513c72667e75f6d9833cce9a077569b4f27bf3d422498540e48e9cda8741df441e072bdac917d8c379bd48a8423713650d80fc15
2025-05-09 05:30:08 +02:00

1 line
831 B
Plaintext

{"version":3,"file":"useRouter.cjs","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":["React","getRouterContext"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAKO,SAAS,UAAwD,MAE5D;AACV,QAAM,QAAQA,iBAAM,WAAWC,cAAA,iBAAA,CAAkB;AACjD;AAAA,IACE,IAAG,6BAAM,SAAQ,SAAS,CAAC;AAAA,IAC3B;AAAA,EACF;AACO,SAAA;AACT;;"}