You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, thanks for those amazing libraries.
One of the last release contains many really useful updates. urlName was a lifesaver for me because it allowed me to get rid of a lot of workarounds.
And it's seems like i found a bug
Problem
The problem occurs when using urlName
In this example prev object inside setQuery callback will never contain paramWithAlias property, however the query state object will be up to date
constStringParamWithAlias={...StringParam,urlName: 'alias'}// URL https:[...]?alias=example&other=hereconst[query,setQuery]=useQueryParams({paramWithAlias: StringParamWithAlias,other: StringParam})useEffect(()=>{setQuery(prev=>{console.log(prev)// ! will be { other: 'here' } without `paramWithAlias`return ...
})},[])