Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
jxy

How to install "CustomEase" for React?

Go to solution Solved by OSUblake,

Recommended Posts

  • jxy changed the title to How to install "CustomEase" for React?
  • Solution

Welcome to the forums @jxy

 

What's barely working? And what can be done to make it better?

 

CustomEase is a bonus to all registered users, as explained on the CustomEase FAQ, so you need to download the files from the installation page.

 

React users include GSAP in a variety of different ways, but I'm going to assume you want the npm method. Please check out this video at around 2:50, it explains it better than I can in a forum post...

 

 

  • Like 1
Link to comment
Share on other sites

Hi, thank you for your reply!

 

I have successfully installed customEase and I can see it in my node_modules folder.

 

How to import CustomEase into my React project then?

 

Like I said the installation page isn't working. It shows the same (wrong) import code whatever modules I check on.

Screenshot 2021-10-22 at 11.29.56 AM.png

Link to comment
Share on other sites

Hey @jxy

 

That's very strange. What browser/OS are you seeing that in? And do you see any errors in the console?

 

It's working perfectly fine for me...

 

image.png

 

So you would import like this...

import { gsap } from "gsap";
import { CustomEase } from "gsap/CustomEase";

gsap.registerPlugin(CustomEase);

 

Unless you are using next.js, which doesn't support ES Modules at the moment, so you would have to import the UMD files.

import { gsap } from "gsap/dist/gsap";
import { CustomEase } from "gsap/dist/CustomEase";

gsap.registerPlugin(CustomEase);

 

  • Like 2
Link to comment
Share on other sites

Hi @OSUblake

 

I am on Chrome/Mac. Here's the console message. The webpage worked in Incognito mode though, not sure what blocked it in regular mode.

 

Yes, i am using Nextjs! Thanks for your tip!

 

Screenshot 2021-10-23 at 1.27.16 PM.png

  • Like 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.
×