fridays / next-routes

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

Click on link and URL update is not working #327

Closed umakantp closed 4 years ago

umakantp commented 4 years ago

I do not know if this is bug or code issue (so that I should file in stackoverflow). Since everything done as per docs and nothing works I'm posting here. As per docs I have written as follows in my home page (/).

<Link route="/slug/title/241374">
    <a>Test Page</a>
</Link>

Now If I'm clicking on the link and it doesn't go to the route. Routes are defined like this:-

const routes = module.exports = require('next-routes')();

routes
  .add('TestPage/TestPageComponent', '/:slug/:title/:id');

The Link used here is used from next-routes. Now if I remove first "/" from the route "/slug/title/241374" it works, but then it loads the full page (instead behaving like SPA). What is wrong here ?

next: 9.1.5 / 9.1.6 next-routes: 1.4.2 react: 16.12.0 react-dom: 16.12.0

umakantp commented 4 years ago

I figured out the issue. Closing the ticket.