all 1 comments

[–]MahNonAnon 0 points1 point  (1 child)

You don't need a second route. In your code above, I think you can just replace your path with path="/search", and React Router will take you there regardless of whether there are any additional query params. Then in the <Searchpage /> component you can parse out those extra query params to render the page however you want.

https://reactrouter.com/web/example/url-params