How can I get (query string) parameters from the URL in Next.js?

后端 未结 8 554
情深已故
情深已故 2020-12-13 01:32

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

8条回答
  •  Happy的楠姐
    2020-12-13 02:31

    • 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 } } }) => (
      

    Welcome to About! { name }

    )

提交回复
热议问题