Explorar el Código

fix: 修改headerRight水合错误

ansoni hace 1 mes
padre
commit
9addee435d
Se han modificado 2 ficheros con 5 adiciones y 3 borrados
  1. 4 2
      src/app/[locale]/(TabBar)/layout.tsx
  2. 1 1
      src/components/Header/index.tsx

+ 4 - 2
src/app/[locale]/(TabBar)/layout.tsx

@@ -1,5 +1,5 @@
 import Footer from "@/components/Footer";
-import { FC, PropsWithChildren } from "react";
+import { FC, PropsWithChildren, Suspense } from "react";
 type Props = {};
 
 const Layout: FC<PropsWithChildren<Props>> = (props) => {
@@ -7,7 +7,9 @@ const Layout: FC<PropsWithChildren<Props>> = (props) => {
     return (
         <>
             <main className={"main-footer"}>{children}</main>
-            <Footer />
+            <Suspense>
+                <Footer />
+            </Suspense>
         </>
     );
 };

+ 1 - 1
src/components/Header/index.tsx

@@ -6,7 +6,7 @@ import styles from "./style.module.scss";
 // import HeaderRight from "@/components/Header/HeaderRight";
 import dynamic from "next/dynamic";
 
-const HeaderRight = dynamic(() => import("@/components/Header/HeaderRight"));
+const HeaderRight = dynamic(() => import("@/components/Header/HeaderRight"), { ssr: false });
 /**
  * @description HeaderProps
  * @param {boolean} headerPlaceholder 是否展示展位元素00