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 /about?name=leangchhean) from /index.js
to /about.js
, I don't know how to get it in the /about.js
page.
index.js
import Link from 'next/link';
export default () => (
<div>
Click{' '}
<Link href={{ pathname: 'about', query: { name: 'leangchhean' } }}>
<a>here</a>
</Link>{' '}
to read more
</div>
);