We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 890c520 + f9b6dc6 commit e30f46fCopy full SHA for e30f46f
.changeset/stupid-trainers-shake.md
@@ -0,0 +1,5 @@
1
+---
2
+"@solidjs/router": patch
3
4
+
5
+Make useHref return a string with string param
src/routing.ts
@@ -68,7 +68,7 @@ export const useResolvedPath = (path: () => string) => {
68
return createMemo(() => route.resolvePath(path()));
69
};
70
71
-export const useHref = (to: () => string | undefined) => {
+export const useHref = <T extends string | undefined>(to: () => T): () => string | T => {
72
const router = useRouter();
73
return createMemo(() => {
74
const to_ = to();
0 commit comments