diff --git a/packages/toolpad-core/src/nextjs/NextAppProviderPages.tsx b/packages/toolpad-core/src/nextjs/NextAppProviderPages.tsx index c26f6c9fc0d..ac918983c7e 100644 --- a/packages/toolpad-core/src/nextjs/NextAppProviderPages.tsx +++ b/packages/toolpad-core/src/nextjs/NextAppProviderPages.tsx @@ -8,7 +8,7 @@ import type { AppProviderProps, Navigate, Router } from '../AppProvider'; * @ignore - internal component. */ export function NextAppProviderPages(props: AppProviderProps) { - const { push, replace, asPath, query } = useRouter(); + const { push, replace, pathname, query } = useRouter(); const search = React.useMemo(() => { const params = new URLSearchParams(); @@ -38,11 +38,11 @@ export function NextAppProviderPages(props: AppProviderProps) { const routerImpl = React.useMemo( () => ({ - pathname: asPath, + pathname, searchParams, navigate, }), - [asPath, navigate, searchParams], + [navigate, pathname, searchParams], ); return ; diff --git a/playground/nextjs-pages/next-env.d.ts b/playground/nextjs-pages/next-env.d.ts index 725dd6f2451..3cd7048ed94 100644 --- a/playground/nextjs-pages/next-env.d.ts +++ b/playground/nextjs-pages/next-env.d.ts @@ -3,4 +3,4 @@ /// // NOTE: This file should not be edited -// see https://nextjs.org/docs/app/building-your-application/configuring/typescript for more information. +// see https://nextjs.org/docs/app/api-reference/config/typescript for more information. diff --git a/playground/nextjs/next-env.d.ts b/playground/nextjs/next-env.d.ts index 40c3d68096c..1b3be0840f3 100644 --- a/playground/nextjs/next-env.d.ts +++ b/playground/nextjs/next-env.d.ts @@ -2,4 +2,4 @@ /// // NOTE: This file should not be edited -// see https://nextjs.org/docs/app/building-your-application/configuring/typescript for more information. +// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.