From 2b001973a7bc5c2388cea85ed7f870839cc522ea Mon Sep 17 00:00:00 2001 From: Defectink Date: Fri, 22 Apr 2022 15:25:03 +0800 Subject: [PATCH] Upgrade to React 18 --- components/DarkModeBtn.tsx | 4 ++-- components/Footer.tsx | 3 +-- components/NavBar.tsx | 4 ++-- components/PostCard.tsx | 3 +-- components/RUA/RUASandpack.tsx | 3 +-- components/gists/GistsCode.tsx | 3 +-- components/post/PostComment.tsx | 3 +-- components/post/PostTOC.tsx | 3 +-- layouts/MDXLayout.tsx | 4 ++-- layouts/MainLayout.tsx | 7 +++++-- next.config.mjs | 1 - tsconfig.json | 2 +- 12 files changed, 18 insertions(+), 22 deletions(-) diff --git a/components/DarkModeBtn.tsx b/components/DarkModeBtn.tsx index 41a2ba2..ecdf3ce 100644 --- a/components/DarkModeBtn.tsx +++ b/components/DarkModeBtn.tsx @@ -1,8 +1,8 @@ import { useTheme } from 'next-themes'; -import { FC, useEffect, useState } from 'react'; +import { useEffect, useState } from 'react'; import { FiMoon, FiSun } from 'react-icons/fi'; -const DarkModeBtn: FC = () => { +const DarkModeBtn = () => { const [mounted, setMounted] = useState(false); const { systemTheme, theme, setTheme } = useTheme(); // When mounted on client, now we can show the UI diff --git a/components/Footer.tsx b/components/Footer.tsx index 6f4b2d0..2ad7706 100644 --- a/components/Footer.tsx +++ b/components/Footer.tsx @@ -1,9 +1,8 @@ -import { FC } from 'react'; import { FiGithub } from 'react-icons/fi'; const nowDay = new Date().getFullYear(); -const Footer: FC = () => { +const Footer = () => { return ( <>