Jump to content
GreenSock

martis

React and GSAP

Recommended Posts

Hm, it doesn't look like you loaded/imported the TextPlugin (which is required for the "text" tween). 

 

import TextPlugin from "gsap/TextPlugin";

 

Does that resolve things? If you're still having trouble, please provide a reduced test case, perhaps using https://codesandbox.io/ and we'd be happy to help (though I'm no React expert). 

Link to comment
Share on other sites

I added this before but saw no difference:

 

import {TweenLite, Linear, TextPugin} from 'gsap';

 

I'll see what I can work up with the codesandbox in a bit.

Link to comment
Share on other sites

No no, "gsap" just points to the "TweenMax" file, thus "TextPlugin" is not inside of that. Sorry. That's why I said to import it directly like "gsap/TextPlugin". Have you tried that? 

  • Like 1
Link to comment
Share on other sites

Zomg it worked Jack. This makes me very happy. Ok, so you handed me a fish. The question now becomes, how do I fish these import answers for myself? Is there documentation on what to import for a given operation?

 

import React, { Component } from 'react';
import {TweenLite, Linear} from 'gsap';
import TextPlugin from "gsap/TextPlugin";  // This worked! 

 

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