diff --git a/.changeset/stupid-trainers-shake.md b/.changeset/stupid-trainers-shake.md new file mode 100644 index 000000000..870e2ea7b --- /dev/null +++ b/.changeset/stupid-trainers-shake.md @@ -0,0 +1,5 @@ +--- +"@solidjs/router": patch +--- + +Make useHref return a string with string param diff --git a/src/routing.ts b/src/routing.ts index e9ccc0669..d426a9312 100644 --- a/src/routing.ts +++ b/src/routing.ts @@ -68,7 +68,7 @@ export const useResolvedPath = (path: () => string) => { return createMemo(() => route.resolvePath(path())); }; -export const useHref = (to: () => string | undefined) => { +export const useHref = (to: () => T): () => string | T => { const router = useRouter(); return createMemo(() => { const to_ = to();