Is this really the most ergonomic way to preserve searchParams with <A>?
I've got what I imagine is a pretty common pattern: displaying a list of entities on the left, each one clickable, and when you click it a detail view shows up on the right. The list is filterable, and those filters end up as searchParams. An example URL might be
This works, but it feels... unergonomic. Is there a better or cleaner way to preserve the searchParams when using
/locations/123/leads/456?leadsCategory=3. For the anchor tags on the left, I've got the following JSX (searchParams is destructured from useSearchParams()):This works, but it feels... unergonomic. Is there a better or cleaner way to preserve the searchParams when using
<A /> or is this the "right" way?