Jump to content
Search Community

KerveCreative

Business
  • Posts

    4
  • Joined

  • Last visited

Community Answers

  1. KerveCreative's post in Errors when trying to use Draggable plugin with Next.js / React was marked as the answer   
    In typical fashion, after posting I've now resolved this issue with some more searching.
     
    I had tried removing the following registerPlugin line altogether:
    gsap.registerPlugin(Draggable);  
    But that gave another error:
    TypeError: _toArray is not a function
     
    So I knew this was needed.
     
    It turns out that adding a condition to check for the window object around this line solves the issue.
     
    The following now works fine:
    import { gsap } from 'gsap'; import { Draggable } from 'gsap/dist/Draggable'; if (typeof window !== 'undefined') { gsap.registerPlugin(Draggable); }
×
×
  • Create New...