UNPKG

@tanstack/vue-router

Version:

Modern and scalable routing for Vue applications

14 lines (13 loc) 446 B
import { routerContext } from "./routerContext.js"; import * as Vue from "vue"; //#region src/useRouter.tsx 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; } //#endregion export { useRouter }; //# sourceMappingURL=useRouter.js.map