The useGSAP hook has a dependency for at least React 16, but it doesn't use/install React 16:
"dependencies": {
"gsap": "^3.12.5",
"react": ">=16"
},
If you already have React 18 installing the @gsap/react package won't change a thing and won't install another version of React.
I just tested this on a demo here on my local machine using the latest version of Next without any issues. We only encountered some issues while importing the @gsap/react package from esm.sh, which solves by doing this:
import React from "https://esm.sh/react@18.3.1";
import ReactDOM from "https://esm.sh/react-dom@18.3.1";
import gsap from "https://esm.sh/gsap";
import { useGSAP } from "https://esm.sh/@gsap/react?deps=react@18.3.1";
We'll update the dependencies on the hook to be at least version 17 of React.
Finally it would be super helpful if you could create a minimal demo that reproduces this error.
Happy Tweening!