Files
plane/web/core/hooks/store/use-router-params.ts
Prateek Shourya 6828d33c3f [WEB-1634] dev: update application router to support n-progress. (#4846)
* [WEB-1634] dev: update application router to support n-progress.

* chore: update app router initilization logic.

* fix: lint errors
2024-06-18 11:35:20 +05:30

11 lines
375 B
TypeScript

import { useContext } from "react";
// store
import { StoreContext } from "@/lib/store-context";
import { IRouterStore } from "@/store/router.store";
export const useRouterParams = (): IRouterStore => {
const context = useContext(StoreContext);
if (context === undefined) throw new Error("useRouterParams must be used within StoreProvider");
return context.router;
};