Using Splittext Plugin of Gsap in React Js

I am trying to use the SplitText plugin of GSAP in React JS to make a text reveal animation but I am not able to import it in spite of installing gsap. I don't know where to import it from. I have tried import SplitText from "gsap/SplitText"; but I am getting a not found error. Please help me to understand how to properly install gsap along with its plugins in React JS.

I am trying to replicate this text reveal in my project : Click Here

1 Answer

Installed gsap-trial from npm and then import SplitText using import SplitText from "gsap-trial/SplitText" and then register the plugin using gsap.registerPlugin(SplitText); and now everything will work fine.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Sarah Jenkins

Sarah Jenkins

Senior Technology Editor & AI Specialist

Sarah Jenkins is a veteran tech journalist with over 12 years of experience covering artificial intelligence, mobile innovations, and digital ethics. Her insights have appeared in leading technology publications worldwide.

Share this article
Twitter Facebook Pinterest