fix: fix useMatch hook

This commit is contained in:
Andrea 2024-09-25 09:27:52 +02:00
parent 888f6c3b01
commit 73f0401565
No known key found for this signature in database
GPG Key ID: 4594610B9C8F91C5

View File

@ -5,10 +5,10 @@ export function useMatch() {
const { handle, ...rest } = matches[matches.length - 1];
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 };
};
}