I am using react-router-dom
v 5.2.0. I want to add multiple query params in the URL and I'm not sure how to accomplish it.
My route looks like this:
<Route path="/admin/users" component={UserList} />
I want to pass multiple query params like...
/admin/users?search=hello&page=1&user_role=admin
Currently I'm doing it manually like...
<Link to="/admin/users?user_role=admin" />
However, with this manual thing I cannot concat multiple query params. Is there a way to concat the query params dynamically? Does react-router-dom
has it's own way of doing such things?