Skip to content

Commit

Permalink
fix: forward NavigateOptions in adaptForAppRouterInstance
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeffrey committed Jul 10, 2023
1 parent c6b163f commit c167125
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/next/src/shared/lib/router/adapters.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { ParsedUrlQuery } from 'node:querystring'
import React, { useMemo, useRef } from 'react'
import type { AppRouterInstance } from '../app-router-context'
import type {AppRouterInstance, NavigateOptions} from '../app-router-context'
import { PathnameContext } from '../hooks-client-context'
import type { NextRouter } from './router'
import { isDynamicRoute } from './utils'
Expand All @@ -24,11 +24,11 @@ export function adaptForAppRouterInstance(
refresh(): void {
router.reload()
},
push(href: string): void {
void router.push(href)
push(href: string, { scroll }:NavigateOptions = {}): void {
void router.push(href, undefined, { scroll })
},
replace(href: string): void {
void router.replace(href)
replace(href: string, { scroll }:NavigateOptions = {}): void {
void router.replace(href, undefined, { scroll })
},
prefetch(href: string): void {
void router.prefetch(href)
Expand Down

0 comments on commit c167125

Please sign in to comment.