Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

history.push in nextjs

import { useRouter } from 'next/router'

export default function Page() {
  const router = useRouter()

  return (
    <button type="button" onClick={() => router.push('/about')}>
      Click me
    </button>
  )
}
Source by nextjs.org #
 
PREVIOUS NEXT
Tagged: #nextjs
ADD COMMENT
Topic
Name
4+7 =