Jump to content
GreenSock

martis

GSAP 3 ES6 + Typescript question

Recommended Posts

Hi all,

 

I installed 3.0.1 and am having some issues importing while using Typescript.

 

import { gsap } from "gsap";

 

[ts] Module '"gsap"' has no exported member 'gsap'.
import gsap

 

I was previously using @types/gsap. Do I need to update these definitions somewhere?


Thanks!

Link to comment
Share on other sites

14 minutes ago, martis said:

I am using TypeScript and was previously using @types/gsap. Do I need to update these definitions somewhere?

GSAP's official TypeScript definitions should be included in your import by default. They are still a work in progress though, so we'd love your help in improving them!

  • Like 1
Link to comment
Share on other sites

Ok removing my old types seemed to of worked. Lemme see if I can get things typed correctly :)

 

This is working...

 

const tl = React.useRef<GSAPStatic.Timeline>();
tl.current = gsap.timeline({ paused: true });

How does importing easing look like in 3.0?

 

Nm... I see you can just now use them as string

 

ease: "expo.inOut"

 

This is great, thanks all!

  • Like 2
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.
×