NativeScript / playground-feedback

Feedback for NativeScript Playground
Apache License 2.0
16 stars 1 forks source link

How to use Greensock libraries in a NativeScript project #175

Open lapodelapis opened 4 years ago

lapodelapis commented 4 years ago

I would like to use Greensock timelines and tween in a NativeScript project. I found two NPMs: greensock and gsap (I suppose the second one is more recent). With the first one, after adding the package to the project, I write something like "import as Greensock from 'greensock';", but the platform replies "Cannot find the module 'greensock'". With the second one (GSAP) I don't really understand how to do that. I add the GSAP module in the project, then I write "import as GSAP from 'gsap';". Then I can even assign the types with "let tlConfig: GSAPTimelineVars = { paused: true }; let tl: GSAPTimeline; let tween: GSAPTween;". But when I try to assign something to variables or any other command with the "gsap" object ("tl = gsap.timeline(tlConfig)" or "tween = gsap.to(".foo", tweenConfig);"), the program replies that it cannot find the "gsap" module. Can someone explain me how to do this? Thank you.