pbeshai / use-query-params

React Hook for managing state in URL query parameters with easy serialization.
https://pbeshai.github.io/use-query-params
ISC License
2.15k stars 96 forks source link

use-query-params with query-string ^7 loads parseUrl() as an Object in production #178

Closed BirdTho closed 2 years ago

BirdTho commented 3 years ago

I have this use-query-params library, and in local React development it works fine, but when I deploy on production then do anything that would change the URL, such as using a set*() method on a useQueryParam() hook I immediately get issues in a more production scenario.

In updateLocation.ts/js (and I'm using Typescript) there's a call to parseUrl() in updateLocation() which registers as an Object, but is being called like a function. What might cause this sort of hiccup?

var href = parseUrl(location.href || '').url + search;

siddharth329 commented 3 years ago

I too am having the same problem image

daisybaicai commented 3 years ago

you should install query-string and use-query-params, i solve this problem when i install query-string

hugomartinet commented 2 years ago

Thanks for the tip! @pbeshai Maybe query-string should be listed in the dependencies?