access to dynamic query params in nextjs

i have a project with nextjs and i have a route like this => /categories/224?brand[0]=6.
i want when ever this query changed forExample /categories/224?brand[0]=8 my useEffect run again
this is my useEffect

    const router = useRouter();

useEffect(()=>{
  console.log('hey there');
},[])

i don’t want my useEffect run when ever whole router.query change i just it runs when ever router.query.brand[0] changed.