@tanstack/vue-router
Version:
Modern and scalable routing for Vue applications
13 lines (12 loc) • 417 B
JavaScript
import { routerContext } from "./routerContext.js";
import * as Vue from "vue";
import warning from "tiny-warning";
//#region src/useRouter.tsx
function useRouter(opts) {
const value = Vue.inject(routerContext, null);
warning(!((opts?.warn ?? true) && !value), "useRouter must be used inside a <RouterProvider> component!");
return value;
}
//#endregion
export { useRouter };
//# sourceMappingURL=useRouter.js.map