How to change the search query parameters regardless of current route? #2620
-
First, my use case: there is a list of items on Now, the list is sortable either by "asc" or "desc". That sorting state should go into the URL, into navigate({ to: "items/$id", params: { id: 12 }, search: true }) All good so far. Now my question: How can the ordering dropdown component change the URL's navigate({ search: prev => ({ ...prev, ordering: "asc" }) }) But, obviously, that doesn't type-check (although it works at runtime). Is there some way to get this to work? Or some pattern I'm missing? Tanner himself made the following comment 1.5years back, so I don't think that's still valid? #507 (reply in thread) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Does this work? navigate({ to: ".", search: prev => ({ ...prev, ordering: "asc" }) }); |
Beta Was this translation helpful? Give feedback.
Does this work?