From ef72f5fc58f26778d67ec6893d2628a27edc0849 Mon Sep 17 00:00:00 2001 From: denshooter Date: Mon, 2 Mar 2026 01:03:51 +0100 Subject: [PATCH] fix: move ShaderGradientBackground dynamic import into client wrapper next/dynamic with ssr:false is not allowed in Server Components. Follows existing BackgroundBlobsClient pattern. Co-Authored-By: Claude Sonnet 4.6 --- .../ShaderGradientBackgroundClient.tsx | 16 ++++++++++++++++ app/layout.tsx | 9 ++------- 2 files changed, 18 insertions(+), 7 deletions(-) create mode 100644 app/components/ShaderGradientBackgroundClient.tsx diff --git a/app/components/ShaderGradientBackgroundClient.tsx b/app/components/ShaderGradientBackgroundClient.tsx new file mode 100644 index 0000000..7c16a5a --- /dev/null +++ b/app/components/ShaderGradientBackgroundClient.tsx @@ -0,0 +1,16 @@ +"use client"; + +import React, { useEffect, useState } from "react"; +import ShaderGradientBackground from "./ShaderGradientBackground"; + +export default function ShaderGradientBackgroundClient() { + const [mounted, setMounted] = useState(false); + + useEffect(() => { + setMounted(true); + }, []); + + if (!mounted) return null; + + return ; +} diff --git a/app/layout.tsx b/app/layout.tsx index 60c1604..754785b 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -2,16 +2,11 @@ import "./globals.css"; import { Metadata } from "next"; import { Inter, Playfair_Display } from "next/font/google"; import React from "react"; -import dynamic from "next/dynamic"; import ClientProviders from "./components/ClientProviders"; +import ShaderGradientBackgroundClient from "./components/ShaderGradientBackgroundClient"; import { cookies } from "next/headers"; import { getBaseUrl } from "@/lib/seo"; -const ShaderGradientBackground = dynamic( - () => import("./components/ShaderGradientBackground"), - { ssr: false, loading: () => null } -); - const inter = Inter({ variable: "--font-inter", subsets: ["latin"], @@ -41,7 +36,7 @@ export default async function RootLayout({