Replies: 2 comments 4 replies
-
why not use local or session storage? |
Beta Was this translation helpful? Give feedback.
3 replies
-
Couldn't you add the current search params to the link in the menu if the current location matches the target location of the menu link? Should be doable with |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
We have a menu which dynamically renders menu items (styled react router Link components) based on array of elements.
Example of menu items array:
Let's say our events page has filter state in the search params. User can logout and log back in or refresh the page and the filters are re-initialised from the URL params when this happens. This works well.
Now let's consider another case. User is on events page, has some filter state in search params and decides to click on events page menu item. Filters are lost. Reason for this is that in this case we navigate to
/events
page without propagating search params.We could sync search params with localStorage or some other store but I would prefer that for now we don't have to do this.
Does anybody know an elegant solution for this?
Our menu and menu-items components:
I have a short term solution for this but in my opinion it is a bad one and in best case temporary:
Beta Was this translation helpful? Give feedback.
All reactions