aboutsummaryrefslogtreecommitdiff
path: root/packages/web-util/src/context/navigation.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/web-util/src/context/navigation.ts')
-rw-r--r--packages/web-util/src/context/navigation.ts3
1 files changed, 2 insertions, 1 deletions
diff --git a/packages/web-util/src/context/navigation.ts b/packages/web-util/src/context/navigation.ts
index c2f2bbbc1..bd756318b 100644
--- a/packages/web-util/src/context/navigation.ts
+++ b/packages/web-util/src/context/navigation.ts
@@ -22,6 +22,7 @@ import {
Location,
findMatch,
RouteDefinition,
+ LocationNotFound,
} from "../utils/route.js";
/**
@@ -44,7 +45,7 @@ export const useNavigationContext = (): Type => useContext(Context);
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export function useCurrentLocation<T extends ObjectOf<RouteDefinition<any>>>(
pagesMap: T,
-): Location<T> | undefined {
+): Location<T> | LocationNotFound<T> {
const pageList = Object.keys(pagesMap as object) as Array<keyof T>;
const { path, params } = useNavigationContext();