Open seregap opened 3 months ago
ha this has never come up before but definitely has a use case, I agree with your proposal, an additional optional string prop to $path
prs welcome
Worth mentioning that hash is not passed to the server side by default, so it can only be used in client side hooks. This separation between server/client is quite a bit of a headache in this case.
@seregap I'd say you're better off just using $path({ ... }) + `#some-hash`
.
Is there a way of describing or using a hash? There is no mention of it in either the documentation or the examples.
This could be as follows:
$path({ route: "/product/[productID]", routeParams: { productID: 23 }, searchParams: { userInfo: { name: "bob", age: 23 } }, hash: "some-hash", })
// this generates the following string: // "/product/23?userInfo=%7B%22name%22%3A%22bob%22%2C%22age%22%3A23%7D#some-hash"