Closed luixo closed 9 months ago
When using useUpdateSearchParams, if no parameters are in the resulting URLSearchParams - the url is updated to http://localhost:3000/page?
useUpdateSearchParams
URLSearchParams
http://localhost:3000/page?
Trailing question mark should be removed if no parameters are present.
The fix should should be to replace this line:
const action = router[options?.webBehavior ?? (shouldReplace ? 'replace' : 'push')] - action(`${pathname}?${next.toString()}`) + const stringifiedNext = next.toString(); + action(`${pathname}${stringifiedNext ? `?${stringifiedNext}` : ''}`) },
No response
- Solito: 4.1.3 - Next.js: 14.0.3 - Expo: - - React Native: -
Happy to merge a PR
Is there an existing issue for this?
Do you want this issue prioritized?
Current Behavior
When using
useUpdateSearchParams
, if no parameters are in the resultingURLSearchParams
- the url is updated tohttp://localhost:3000/page?
Expected Behavior
Trailing question mark should be removed if no parameters are present.
The fix should should be to replace this line:
Steps To Reproduce
No response
Versions
Screenshots
No response
Reproduction
No response