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

后端 未结 8 560
情深已故
情深已故 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条回答
  •  我在风中等你
    2020-12-13 02:28

    If you need to retrieve a URL query from outside a component:

    import router from 'next/router'
    
    console.log(router.query)
    
    

提交回复
热议问题