Jump to content
Search Community

CRA is Breaking the ScrollTrigger

FirstEight test
Moderator Tag

Recommended Posts

I converted this codepen into a CRA Application for further work.

Well i like / love GSAP btw. 

 

i swapped everything into the App.js of my CRA and imported all the things like this

 

import React from "react";
import { useEffect, useLayoutEffect, useRef } from "react"
import { gsap } from "gsap";
import { ScrollTrigger } from "gsap/ScrollTrigger";
import SplitType from 'split-type';

 

tried useEffect and useLayoutEffect

 

everything else is exactly like in the codepen.

 

when i start the page, the timelines are playing like 0.0001 seconds and then stop... so i got a lot of opacity: 0.01 items in space and it kinds works only when i re-enter the trigger space from the bottom ( toggleActions: "restart reverse restart reverse" ) on all the timelines.

 

why is it breaking? any clue?

See the Pen ExpqdBg by JayBERLIN (@JayBERLIN) on CodePen

Link to comment
Share on other sites

Hi,

 

I see that everything in the codepen is working exactly as it should, right? Is there an issue in the codepen? Sorry if I'm missing something obvious here.

 

As for CRA as far as I know it shouldn't cause any issues whatsoever with your GSAP animations. I see that you're using GSAP Context in all your components so that doesn't seem to be the issue.

 

It would be ideal if you could create an reduced example in Stackblitz (select React Javascript for CRA setup) so we can take a look at it (try to keep it as small as possible and point us directly to the part/line number that is not working).

 

Happy Tweening!

Link to comment
Share on other sites

well i will make a stackblitz soon,

 

yea everything's alright in the codepen itself. i really dont know why its breaking apart in my CRA

 

on the screenshot i scrolled down and it stays like this. it starts to play when i go to top again. but not everything works. its more like a big cup of bug-noodels.

 

T_T  -  well lets see -

 

thank you for your first response

photo_2023-02-17_14-40-02.jpg

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