Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

nextjs on route change content not changing

const router = useRouter();

   useEffect(() => {
    if (isMenuOpen) {
      setMenuOpen(!isMenuOpen);
    }
  }, [router.asPath]);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #nextjs #route #change #content #changing
ADD COMMENT
Topic
Name
3+5 =