Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

159
Vistas
Using javascript / gsap in react

So I have a question on how to use this little bit of script in my react app.

  const tl = gsap.timeline({ defaults: { ease: "power1.out" } });

  tl.to("body", { overflow: "hidden" });
  tl.to(".text", { x: "0%", duration: 0.5 });
  tl.fromTo(
    ".textleft, .textright",
    { opacity: 0 },
    { x: "0%", opacity: 1, duration: 1.5 }
  );
  tl.to(".sliderasd", { y: "-100%", duration: 1.5, delay: 0.5 });
  tl.to(".intro", { y: "-100%", duration: 1 }, "-=1");
  tl.to(".newsletter-form", { y: "0%", duration: 1 }, "-=1");
  tl.to("body", { overflow: "", scrollTrigger: "body" });
  tl.fromTo(
    ".slideshow-container",
    { opacity: 0 },
    { opacity: 1, duration: 3 }
  );

It should be an intro animation to my website. I try to save it as a component and then export it to App.jsx but it doesnt seem to work. Of course i have imported GSAP.

Also when I put the code inside App function, it works only for one time and when i refresh the page nothing happens. The classes in the code are in different components.

I also have the same problem with slider I have created which seems to be working in non-react app.

Basiclly I would like to find out how can I use any JS script in my react app

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda