qwik icon indicating copy to clipboard operation
qwik copied to clipboard

The useLocation().query object values should return string or Array<string>

Open tuurbo opened this issue 3 years ago • 1 comments
trafficstars

Qwik Version

qwik 0.11.0, qwik city 0.0.112

Operating System (or Browser)

chrome

Node Version (if applicable)

16.14.2

Which component is affected?

Qwik City

Expected Behaviour

The url example.com?brand=amd&brand=intel&category=cpu contains two "brand" query params and one "category" query param.

useLocation().query should return { brand: ['amd', 'intel'], category: 'cpu' }

Actual Behaviour

useLocation().query returns { brand: 'intel', category: 'cpu' }, only returning the last "brand" query param.

Additional Information

demo https://stackblitz.com/edit/qwik-starter-7bcp3c?a=1&file=src%2Froutes%2Findex.tsx

tuurbo avatar Oct 16 '22 03:10 tuurbo

The query object is now a URLSearchParams as of https://github.com/BuilderIO/qwik/pull/2385

Thanks for opening the issue!

adamdbradley avatar Dec 08 '22 16:12 adamdbradley