next-routes
next-routes copied to clipboard
Wrong route and pathname
I registered the following route:
routes.add({
name: 'mensagens',
pattern: '/mensagens',
page: 'quotes',
});
When I check the router param on Router (imported from 'routes') object, I'm getting the follow params:
I'm acessing /mensagens
but I'm getting /quotes
as route and pathname
+1
Next.js Router needs to know these things because that is how it is routing internally. The asPath
property is how the route appears, and the pathname
and route
properties are used to route to the correct component.
/mensagens
in this example should be accessible somehow too.
Would is be possible to have a parameter with the path extracted from the query string? Currently, you could get /mensagens
from asPath
, but when you have a query string it will return that as well when you may only want the base route of /mensagens