fridays / next-routes

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

Load different Pages #81

Closed supra28 closed 7 years ago

supra28 commented 7 years ago

How to load different pages for routes like xyz.com/locations and xyz.com/locations/4 How do I name my routes and use the link component to achieve this?

supra28 commented 7 years ago

I've added my routes like

routes.add("locations", "/locations", "locations")
routes.add("locationPage", "/locations/:id", "location-page")

but when I click this link component

<Link route="locations/54">
          <a>woop</a>
 </Link>

It shows a 404 page and then after a second reloads to the correct page :/

Entering the url directly in the browser works fine.

netoho commented 6 years ago

@supra28 Did you find a solution?

I'am having the exact same problem, maybe it is due to mis configuration https://github.com/fridays/next-routes/issues/114