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.16k stars 96 forks source link

two `setParam()` calls made together overwrite each other #282

Closed hallucinogenizer closed 9 months ago

hallucinogenizer commented 9 months ago

Description

I have reproduced the issue in a codesandbox. Here it is. The sandbox uses NextJS App Router.

I'm not sure if this issue belongs here or in the next-query-params repository.

What the issue is and how to reproduce it in the sandbox

Expected Behavior

hallucinogenizer commented 9 months ago

Found the fix

If you add options: { enableBatching: true } to the <QueryParamProvider />, the issue gets fixed.