In react in my routes, I have mapped the components like
<Route path="/search/:id" component={Search}/>
So, i am expecting a URL like search/jeans, or search/shirts . But on some occasions i am getting a URL pattern like
/search/?text=shirts
Which i am not able to handle. Please suggest how can i proceed with this. I want to get the value of "shirts" from that URL. How to get make the existing route to handle this this different URL ?
The ability to parse query strings was taken out of V4 unfortunately. You can choose which method to use. 3rd party package:
Or use a built in:
and for URLSearchParams, there is also a polyfill for compatibility.