use_location
doesnt recognize new query string on query string updates
#3089
Labels
use_location
doesnt recognize new query string on query string updates
#3089
Problem
I have written a small hook for my application which syncs a serializable state with the query parameters / search string of the page location.
This is required to persist state through page reloads / page shares.
The biggest problem i encountered is that the yew_router hooks rerender my component with an outdated querystring even tho the query string is mutated (for example through pressing a link button or using the browsers forward / backward buttons). Why does that not happen?
It looks like the navigation event is beeing picked up and the component rerenders, just
search
field of the location state is out of sync.Also i encountered it to be pretty unergonomic to be forced to provide the route of the page i am on, just for mutating the query string through use_navigator, is there a better way to do this?
My hook / code looks like this:
Steps To Reproduce
Expected behavior
Provide up to date query string through
location.search
when usinguse_location
to access the search parameters once they are changed.Environment:
Questionnaire
The text was updated successfully, but these errors were encountered: