This is an example of how to do routing as a modal in Next.js, where when the user clicks a link, content is shown within a modal, but when the user refreshes the page, they are on a dedicated page for that content. This is a technique used by both Instagram and Reddit.
In the process we’ll learn about the Next.js router and how to do dynamic linking.
Source Code
https://github.com/leighhalliday/next-route-modal-demo
Next.js example
https://github.com/zeit/next.js/tree/canary/examples/with-route-as-modal
Next.js Link
https://nextjs.org/docs/api-reference/next/link
Next.js Router
https://nextjs.org/docs/api-reference/next/router
#next #react #javascript #web-development