import { useRouter } from 'next/router'; const { query } = useRouter(); console.log(query.search) // for www.abc.com?search=xyz

get values form query params in next js

Similar Code Examples