UNPKG

@tanstack/vue-router

Version:

Modern and scalable routing for Vue applications

12 lines 429 B
import * as Vue from 'vue'; import { routerContext } from './routerContext'; export function useRouter(opts) { const value = Vue.inject(routerContext, null); if (process.env.NODE_ENV !== 'production') { if ((opts?.warn ?? true) && !value) { console.warn('Warning: useRouter must be used inside a <RouterProvider> component!'); } } return value; } //# sourceMappingURL=useRouter.jsx.map