From e38bf81f0dd95db21996c61b0b9f09f00ced8866 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20Orb=C3=A1n?= Date: Fri, 9 Sep 2022 12:39:49 +0200 Subject: [PATCH 1/2] Update _app.tsx --- cli/template/base/src/pages/_app.tsx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/cli/template/base/src/pages/_app.tsx b/cli/template/base/src/pages/_app.tsx index c1c9d2f054..3910827de5 100644 --- a/cli/template/base/src/pages/_app.tsx +++ b/cli/template/base/src/pages/_app.tsx @@ -1,8 +1,6 @@ import "../styles/globals.css"; -import type { AppType } from "next/dist/shared/lib/utils"; +import type { AppProps } from "next/app"; -const MyApp: AppType = ({ Component, pageProps }) => { +export default function MyApp({ Component, pageProps }: AppProps) { return ; }; - -export default MyApp; From 0eb693e1aaf203243cb9eae5249ac4d5a2664421 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20Orb=C3=A1n?= Date: Fri, 9 Sep 2022 12:45:32 +0200 Subject: [PATCH 2/2] fix: use `AppProps` --- cli/template/page-studs/_app/with-auth.tsx | 16 ++++++++-------- cli/template/page-studs/_app/with-trpc.tsx | 6 +++--- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/cli/template/page-studs/_app/with-auth.tsx b/cli/template/page-studs/_app/with-auth.tsx index e0f50c302a..554ad29bf5 100644 --- a/cli/template/page-studs/_app/with-auth.tsx +++ b/cli/template/page-studs/_app/with-auth.tsx @@ -1,16 +1,16 @@ import "../styles/globals.css"; -import type { AppType } from "next/dist/shared/lib/utils"; +import type { AppProps } from "next/app"; +import type { Session } from "next-auth"; import { SessionProvider } from "next-auth/react"; -const MyApp: AppType = ({ - Component, - pageProps: { session, ...pageProps }, -}) => { +export default function MyApp(appProps: AppProps<{ session: Session }>) { + const { + Component, + pageProps: { session, ...pageProps }, + } = appProps; return ( ); -}; - -export default MyApp; +} diff --git a/cli/template/page-studs/_app/with-trpc.tsx b/cli/template/page-studs/_app/with-trpc.tsx index 7efe439a2b..d7ae09f8a9 100644 --- a/cli/template/page-studs/_app/with-trpc.tsx +++ b/cli/template/page-studs/_app/with-trpc.tsx @@ -2,14 +2,14 @@ import { httpBatchLink } from "@trpc/client/links/httpBatchLink"; import { loggerLink } from "@trpc/client/links/loggerLink"; import { withTRPC } from "@trpc/next"; -import type { AppType } from "next/dist/shared/lib/utils"; +import type { AppProps } from "next/app"; import superjson from "superjson"; import type { AppRouter } from "../server/router"; import "../styles/globals.css"; -const MyApp: AppType = ({ Component, pageProps }) => { +function MyApp({ Component, pageProps }: AppProps) { return ; -}; +} const getBaseUrl = () => { if (typeof window !== "undefined") return ""; // browser should use relative url