Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

router.query is undefined in first render

const router = useRouter();
useEffect(()=>{
    if(!router.isReady) return;

    // codes using router.query

}, [router.isReady]);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #undefined #render
ADD COMMENT
Topic
Name
2+6 =