From 7d5afbc682e43a73e6b0755e383dab31c8a51b93 Mon Sep 17 00:00:00 2001 From: Max Leiter Date: Tue, 12 Apr 2022 19:19:06 -0700 Subject: [PATCH] client: fix building with react 18 --- client/components/new-post/index.tsx | 2 +- client/pages/_app.tsx | 9 ++++++--- client/pages/_document.tsx | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/client/components/new-post/index.tsx b/client/components/new-post/index.tsx index 46d5606d..0e0e177f 100644 --- a/client/components/new-post/index.tsx +++ b/client/components/new-post/index.tsx @@ -178,7 +178,7 @@ const Post = ({ [onSubmit] ) - const onChangeExpiration = useCallback((date) => setExpiresAt(date), []) + const onChangeExpiration = useCallback((date: Date) => setExpiresAt(date), []) const onChangeTitle = useCallback( (e: ChangeEvent) => { diff --git a/client/pages/_app.tsx b/client/pages/_app.tsx index e28be06e..3847b43a 100644 --- a/client/pages/_app.tsx +++ b/client/pages/_app.tsx @@ -5,6 +5,7 @@ import "react-loading-skeleton/dist/skeleton.css" import Head from "next/head" import { ThemeProvider } from "next-themes" import App from "@components/app" +import React from "react" type AppProps

= { pageProps: P @@ -48,9 +49,11 @@ function MyApp({ Component, pageProps }: AppProps) { Drift - - - + + + + + ) } diff --git a/client/pages/_document.tsx b/client/pages/_document.tsx index 1aa7a433..e3951bdb 100644 --- a/client/pages/_document.tsx +++ b/client/pages/_document.tsx @@ -19,7 +19,7 @@ class MyDocument extends Document { {initialProps.styles} {styles} - ) + ) as any } }