Jump to content
Search Community

How to install and import the split text plugin on React

ShyneADL
Moderator Tag

Go to solution Solved by GreenSock,

Recommended Posts

Posted

I've been trying all night to install and import Split text on react, I've tried various ways to import the plugin and this is my current code.
 

import React, {useRef} from 'react'
import { useGSAP } from '@gsap/react'
import gsap from 'gsap'
import { SplitText } from "gsap/SplitText"
gsap.registerPlugin(SplitText)

Here's the error message I keep getting:

Internal server error: Failed to resolve import "gsap/SplitText" from "src/components/Onboarding.jsx". Does the file exist?

On further investigation in the node_modules/gsap directory, I realized the SplitText.js file actually doesn't exist, has this feature been deprecated or am I just installing it wrong?

  • Solution
Posted

Ah, that's because SplitText is a membership benefit of Club GSAP. It looks like you haven't joined yet. Just sign up at the "Premium" or "Business" level at https://gsap.com/pricing to get access. 

 

Welcome aboard in advance! 💚

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