"use client";
const require_runtime = require("./_virtual/_rolldown/runtime.cjs");
const require_routerContext = require("./routerContext.cjs");
let react = require("react");
react = require_runtime.__toESM(react, 1);
//#region src/useRouter.tsx
/**
* Access the current TanStack Router instance from React context.
* Must be used within a `RouterProvider`.
*
* Options:
* - `warn`: Log a warning if no router context is found (default: true).
*
* @returns The registered router instance.
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/useRouterHook
*/
function useRouter(opts) {
	const value = react.useContext(require_routerContext.routerContext);
	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
exports.useRouter = useRouter;

//# sourceMappingURL=useRouter.cjs.map