Jump to content
Search Community

Draggable - Cannot set properties of undefined (setting 'touchAction') bug

modulareverything test
Moderator Tag

Go to solution Solved by modulareverything,

Recommended Posts

I have this scrolling/draggable animation I created on CodePen last night that I'm trying to integrate with my React project. The code is working fine in the pen, which you can see here: 


When I'm trying to add it into my React project however I'm getting this error:

TypeError: Cannot set properties of undefined (setting 'touchAction')


I saw this thread and tried running console.log(window) before registering the plugin but had no luck.


I tried moving the registerPlugin function to different parts of my app but it just gives me other errors if not the same one.


I've recreated the bug on Codesandbox here so I hope this is helpful:


See the Pen NWLXdeN by modulareverything (@modulareverything) on CodePen

Link to comment
Share on other sites

9 minutes ago, modulareverything said:

Fixed! It turns out I forgot to use nav.current and was instead just using nav on my trigger


Good job! 🙌


9 minutes ago, modulareverything said:

I can't seem to get the throwable aspect to work. Is this because of the intertia plugin being premium o

Yes, exactly. You can try it on CodePen or CodeSandbox as much as you want.


You can import from the "gsap-trial" package for the premium stuff (only for trying, don't deploy that)  

  • Thanks 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...