From 73f0401565b90e12ad18b43e0fae996ee314e164 Mon Sep 17 00:00:00 2001 From: Andrea Date: Wed, 25 Sep 2024 09:27:52 +0200 Subject: [PATCH] fix: fix useMatch hook --- app/hooks/useMatch.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/hooks/useMatch.ts b/app/hooks/useMatch.ts index 3709fcb..edd31e3 100644 --- a/app/hooks/useMatch.ts +++ b/app/hooks/useMatch.ts @@ -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 }; }; }