I need help figuring out how to extract specific query parameters from a URL in my component. I want to exclude dynamic route parameters, such as {modelId}
. For example, if the URL is
/model/123456?page=2&sort=column&column=value
, I only want to retrieve the following object:
{
page: 2,
sort: "column",
column: "value"
}
Using useRouter().query
includes all parameters, including modelId
. The router object does not seem to provide a way to differentiate between regular and dynamic route parameters.
Can anyone suggest how I can identify regular URL parameters while excluding dynamic ones?