However, although I am importing {GSAP} in my root layout (as shown in the demo), I need to import this as well in the component, otherwise it won't run
import gsap from 'gsap'
import { ScrollTrigger } from 'gsap/all'
import { useLayoutEffect, useRef } from 'react'
gsap.registerPlugin(ScrollTrigger)
Is this how it’s intended? Or am I missing something? Thanks in advance!
I have a project now that uses this code in a NextJS component:
However, although I am importing {GSAP} in my root layout (as shown in the demo), I need to import this as well in the component, otherwise it won't run
Is this how it’s intended? Or am I missing something? Thanks in advance!