I have a component that needs to copy all of the query parameters from the URL. However I do not want to copy dynamic route parameters. So if it is used in a component like: /pages/model/{modelId}.tsx and the url is /model/123456?page=2&sort=column&column=value, I would like to retrieve the following object:
{
page: 2,
sort: "column",
column: "value"
}
I would use useRouter().query but this would include modelId. And the router object doesn't seem to have any other list of parameters.
So how would I distinguish regular URL parameters from dynamic route parameters?