Function for type-safe building of URL strings #4234
Closed
chinanderm
started this conversation in
Ideas
Replies: 1 comment 3 replies
-
|
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Apologies if this exists already and I'm missing it, but it would be really handy if TSR had a function like React Router's
href()
where it can be called with type-safe parameters to return a composedstring
URL.For example:
href({ to: '/my/path/$var', params: { var: "foo" }) // "/my/path/foo"
I know
useLinkProps()
exists but it would be cool if something like this existed as a standalone function and not a React hook.Beta Was this translation helpful? Give feedback.
All reactions