Your opinion: Storing "state" in query params vs redux


#1

Looking for peoples opinions on the criteria you use when deciding to put your state (like on a search page) into redux (or local state) VS into the URL.

For instance, storing in the URL lets your share a specific search results. Storing in redux is (arguably) a little cleaner looking code. What other cost/benefits/considerations cross your mind?


#2

In addition to sharing pages users might want to bookmark a specific page for themselves with the params or pass it around between tabs by manually copying URLs. Both make a strong argument for keeping the data in URLs in my opinion. Especially the latter - modern browsers have powerful UIs due to tabbing and I’d be wary of robbing that functionality from users simply for a cleaner look.


#3

Its about user actions vs pages and the state of certain components. Do you for example want your search results to be linkable? If yes, use the url.


#4

It’s also quite important for search engines that you use URIs properly.