# Is there a way to preserve the query string when moving among tabs?

**URL:** <https://forum.ionicframework.com/t/is-there-a-way-to-preserve-the-query-string-when-moving-among-tabs/232485>\
**Category:** Ionic React\
**Created:** [April 7, 2023, 6:27am UTC](https://forum.ionicframework.com/t/is-there-a-way-to-preserve-the-query-string-when-moving-among-tabs/232485 "2023-04-07T06:27:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ptmkenny](https://avatars.discourse-cdn.com/v4/letter/p/ea666f/32.png) [@ptmkenny](https://forum.ionicframework.com/u/ptmkenny)\
**Post date:** [April 7, 2023, 6:27am UTC](https://forum.ionicframework.com/t/is-there-a-way-to-preserve-the-query-string-when-moving-among-tabs/232485/1 "2023-04-07T06:27:57Z")

</div>

I have an app structured like this:

- Tab Vegetables
- Tab Fruits
- Tab Desserts

Say the user is on the vegetables tab at `/vegetables`. The user clicks a button that goes to the vegetable search page at `/vegetables/search`. Then the user clicks a button that sets a value for the query string: `/vegetables/search?&type=carrot`. Next the user clicks the fruits tab, navigating to `/fruits`. Then the user immediately clicks the vegetables tab again. The URL is now `/vegetables/search`, but the query string value of `?&type=carrot` has been lost.

Does the Ionic react router provide a way to preserve the query string when moving back-and-forth between tabs?

---

<div class="post-metadata">

**Author:** ![aaronksaunders](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/aaronksaunders/32/13729_2.png) [@aaronksaunders](https://forum.ionicframework.com/u/aaronksaunders)\
**Post date:** [April 10, 2023, 4:03pm UTC](https://forum.ionicframework.com/t/is-there-a-way-to-preserve-the-query-string-when-moving-among-tabs/232485/2 "2023-04-10T16:03:39Z")

</div>

us a state manager to track the last query string for each of the tabs, or save it on the tab page since the pages stay in memory
