Navigasi JS berikutnya ke halaman lain dalam suatu fungsi
import { useRouter } from 'next/router'
function Home() {
const router = useRouter()
const handleClick = e => {
e.preventDefault()
router.push('/some-path')
}
return (
<button type="button" onClick={handleClick}>
Go Somewhere
</button>
)
}
Disgusted Dunlin