nuqs icon indicating copy to clipboard operation
nuqs copied to clipboard

Can't change `as` and `href` parameter

Open skasyn opened this issue 3 years ago • 3 comments

First of all, thanks for this great hook. I was looking for somthing to handle query params and this is an almost perfect elegant solution !

Sadly, we had an issue that forced us to stop using it: in our application, we had to use the rewrite functionnality to handle subdomains and ISR (as per this comment). Since useQueryState doesnt't allow setting as parameter, it doesnt work in preview / production where we use the subdomains.

Maybe we could give a path option to the hook instead of using router.pathname ?

skasyn avatar Sep 15 '21 10:09 skasyn

Thanks for your feedback!

Maybe we could give a path option to the hook instead of using router.pathname ?

Do you have an example of this suggested API ?

franky47 avatar Sep 15 '21 12:09 franky47

Is there an update on this request I am having the same issue.

minardimedia avatar Jun 02 '22 20:06 minardimedia

Any update on this issue?

mehulmpt avatar Oct 19 '22 15:10 mehulmpt

The newer versions of nuqs reuse the asPath present in the pages router internals, so this should be fixed.

Closing for now as the internals have changed a lot since this issue was open, feel free to reopen/comment if still relevant.

franky47 avatar Apr 18 '24 22:04 franky47