fix: fix useMatch hook
This commit is contained in:
parent
888f6c3b01
commit
73f0401565
@ -5,10 +5,10 @@ export function useMatch() {
|
|||||||
const { handle, ...rest } = matches[matches.length - 1];
|
const { handle, ...rest } = matches[matches.length - 1];
|
||||||
|
|
||||||
if (handle == null) {
|
if (handle == null) {
|
||||||
throw new Error("Bruh");
|
throw new Error(`handle is missing for ${rest.pathname}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
return { handle, ...rest } as unknown as {
|
return { handle, ...rest } as unknown as typeof rest & {
|
||||||
handle: { to: string; text: string };
|
handle: { to: string; text: string };
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user