When I click on a link in my /index.js
, it brings me to /about.js
page.
However, when I\'m passing parameter name through URL (like
If you need to retrieve a URL query from outside a component:
import router from 'next/router'
console.log(router.query)
Get it by using the below code in the about.js page:
// pages/about.js
import Link from 'next/link'
export default ({ url: { query: { name } } }) => (
<p>Welcome to About! { name }</p>
)