const router = useRouter(); useEffect(()=>{ if(!router.isReady) return; // codes using router.query }, [router.isReady]);