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
Usign wouter v3 (3.3.5 for now) and watching different behavior of useLocation hook.
Previously I was not using base prop for Router and using useLocation to update search query in URL like that:
So starting from /games page after execute of setCategory('123') I was navigated to /games?category=123.
Now I'm trying to add language into URL using base prop for Router and have different behavior: when using base=en and starting from URL /en/games I navigated to /en?category=123.
Please tell me is it expected behavior or it needs to be fixed somehow?
Thank you in advance!
The text was updated successfully, but these errors were encountered:
In wouter terms, ?category=1 isn't a valid path as it doesn't start with a slash so this isn't guaranteed to work properly. I see two workarounds here:
Provide the current path explicitly setLocation('${location}?category=${id}')
Or use location.search = "..." to directly update the search string
Usign wouter v3 (3.3.5 for now) and watching different behavior of useLocation hook.
Previously I was not using
base
prop for Router and using useLocation to update search query in URL like that:So starting from
/games
page after execute ofsetCategory('123')
I was navigated to/games?category=123
.Now I'm trying to add language into URL using
base
prop for Router and have different behavior: when usingbase=en
and starting from URL/en/games
I navigated to/en?category=123
.Please tell me is it expected behavior or it needs to be fixed somehow?
Thank you in advance!
The text was updated successfully, but these errors were encountered: