xxxxxxxxxx
// add this to your next.config.js
async redirects() {
return [
{
source: '/about',
destination: '/',
permanent: true,
},
]
},
xxxxxxxxxx
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>
)
}