Currently, I am working on an application in nuxt.js which utilizes ssr rendering. However, I have encountered a problem with gsap while using typescript. Specifically, when attempting to employ the timeline.staggerTo() method, I receive an error stating that the property staggerTo() does not exist on TimelineMax type.
This is how I am incorporating gsap into my project: I installed it using yarn add gsap then proceeded to import TimelineMax from "gsap"
Although to() functions without any issues, staggerTo and staggerFrom do not work as expected. This could be due to the absence of a definition for these properties. Does anyone know of a possible solution or workaround?
Thank you in advance for your assistance <3
Attached is some sample code:
import Vue from "vue";
import { TweenMax, gsap, TimelineMax } from "gsap";
export default Vue.extend({
mounted() {
const timeline = new TimelineMax();
timeline
.fromTo(
".header__subtitle",
1,
{ opacity: 0, translateY: -30 },
{ opacity: 1, translateY: 0 }
)
.staggerFrom(); //Property 'staggerFrom' does not exist on type 'TimelineMax'.Vetur(2339)
}
});