Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NextJs useGSAP Hydration Failed #608

Open
epenflow opened this issue Dec 25, 2024 · 1 comment
Open

NextJs useGSAP Hydration Failed #608

epenflow opened this issue Dec 25, 2024 · 1 comment

Comments

@epenflow
Copy link

I'm encountering hydration errors when using useGSAP on my NextJs Pages. Whenever i try to use useGSAP on a page, I get a hydration error

{0CDF9F3C-B020-48EE-87CD-A213F1933E5E}

"use client";
import { useGSAP } from "@/config/gsap";
import React from "react";
import "./base.css";

const Page = () => {
	const containerRef = React.useRef<HTMLElement | null>(null);

	useGSAP(() => {}, { scope: containerRef });

	return (
		<main ref={containerRef}>
			<section className="section h-svh w-full border border-red-500 relative">
				<div className="w-1/2 h-1/2 bg-red-500 right-0 absolute trigger" />
			</section>
			<section className="h-svh w-full border border-red-500 relative">
				<div data-step className="w-1/2 h-1/2 " />
			</section>
			<section className="h-svh w-full border border-red-500 relative">
				<div data-step className="w-40 h-40" />
			</section>
		</main>
	);
};

export default Page;
@jackdoyle
Copy link
Member

I believe this has been answered here:
https://gsap.com/community/forums/topic/43281-hydration-error-in-nextjs-15/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants