gvergnaud / nextjs-dynamic-routes

[Deprecated] Super simple way to create dynamic routes with Next.js
MIT License
140 stars 7 forks source link

What is the correct way to use query params? #2

Closed RustyDev closed 6 years ago

RustyDev commented 6 years ago

Thank you for the library. I'm trying to add an optional query param to handle pagination:

/search/keywords/foo?page=2

and my route looks like this:

router.add({ name: 'search-keywords', pattern: '/search/keywords/:keywords'})

gvergnaud commented 6 years ago

Hello, thanks for your support. Currently there is no special way of doing so. The only way of adding query params is to use the standard href and as api from next/link. Supporting query params is a useful feature though, I might add it in the future

lydell commented 5 years ago

This was added in 2.2.0! :tada: See #5.