Skip to content

Commit

Permalink
Update 03-linking-and-navigating.mdx: define const router to disablin…
Browse files Browse the repository at this point in the history
…g scroll
  • Loading branch information
sadaffathali authored Aug 29, 2023
1 parent 8cc9630 commit c1b7cf6
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ The default behavior of the Next.js App Router is to scroll to the top of a new
// useRouter
import { useRouter } from 'next/navigation'

const router = useRouter()

router.push('/dashboard', { scroll: false })
```

Expand Down

0 comments on commit c1b7cf6

Please sign in to comment.