fridays / next-routes

Universal dynamic routes for Next.js
MIT License
2.47k stars 230 forks source link

change value of this.props.url.pathname #35

Closed iamdevonbutler closed 7 years ago

iamdevonbutler commented 7 years ago

I set up my index route like this:

routes.add('index', '/');

this.props.url is injected into my pages w/ a "pathname" attribute...among others. For this particular route, it's pathname value is "/index". I don't see how this value is useful. Shouldn't the pathname be the pattern param. We could also inject the route name param as a property on "url".

On another page I use this route:

routes.add('contactGeneral', '/contact/general', 'contact-general');

And this.props.url.pathname === '/contact-general'. Just doesn't make a lot a sense.

fridays commented 7 years ago

Pathname and other properties are provided by Next.js, please check the docs here. It refers to the current page module.