Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

router in next js

import { useRouter } from 'next/router';
const NavComponent = ({navItems,logo})=> {
const router = useRouter()
return (
     <div onClick={() => {
            router.push('/');
          }}
          className="h-auto transition cursor-pointer hover:scale-105"
        >
          <h4 className="text-2xl text-white uppercase font-neuro hover:text-secondary text-shadow">Straw Hats</h4>
        </div>
)}
 
PREVIOUS NEXT
Tagged: #router #js
ADD COMMENT
Topic
Name
7+7 =