There are two ways to approach this. Either go with query params or path params.
Path params
You route:
<Route path='/movies/:categoryId/:actorId' />
Here you will have route that has two path params /movies/1/2
.
Query params
Your route
<Route path='/movies' />
So your route is only /movies
but you pass query params to it and handle them in your component.
Example of a route with query params /movies?categoryId=1&actorId=2
.
You can use useHistory
hook for that purpose in your routed component.
Personally i preferred to use query params because they are easier to handle in your component, but you can pick your way from these two examples.
In your question, code is a bit wrong, because path params dont need ?
to be present in a route.