Use location.search property to get your current query string. There are native JS solutions to work with those, such as the URLSearchParams object. You can use URLSearchParams for both setting and getting properties in a query string. If your component has access to location (a Route's child or using the useLocation() hook), query string changes trigger a re-render.