Skip to content
This repository was archived by the owner on Jul 6, 2025. It is now read-only.

Commit 9ab6850

Browse files
committed
Expose e404 prop via useRouter
1 parent 29599d4 commit 9ab6850

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

framework/react/router.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -272,9 +272,14 @@ export const App: FC<RouterProps> = (props) => {
272272
);
273273
};
274274

275-
export const useRouter = (): { url: URL; params: Record<string, string>; redirect: typeof redirect } => {
276-
const { url, params } = useContext(RouterContext);
277-
return { url, params, redirect };
275+
export const useRouter = (): {
276+
url: URL;
277+
params: Record<string, string>;
278+
e404?: boolean;
279+
redirect: typeof redirect;
280+
} => {
281+
const { url, params, e404 } = useContext(RouterContext);
282+
return { url, params, e404, redirect };
278283
};
279284

280285
export const forwardProps = (children?: ReactNode, props: Record<string, unknown> = {}) => {

0 commit comments

Comments
 (0)