hzdg / gsap-react-plugin

A GSAP plugin for tweening React.js component state.
Other
130 stars 8 forks source link

usage instructions #9

Open XBDRX opened 9 years ago

XBDRX commented 9 years ago

I'm able to use TweenLite and TimelineLite successfully if I do the following

[.jsx] var gsap = require('gsap-react-plugin');

[index.html] <script src="http://cdnjs.cloudflare.com/ajax/libs/gsap/latest/TweenMax.min.js"></script>

However, I'd like to be able to require TweenMax.min.js instead of including it directly in the .html file. Am I missing something simple, and if not, is it possible to add instructions on how to do this to the readme file?

Thanks!

lettertwo commented 9 years ago

You can add the GSAP lib to your project (in a /vendor/greensock/ dir, for example), and then require it:

require('gsap-react-plugin');
var TweenLite = require('./vendor/greensock/TweenLite');
var TimelineLite = require('./vendor/greensock/TimelineLite');
simonswiss commented 9 years ago

@XBDRX GSAP is also available as an npm package so you can install it this way, and then require it like you require gsap-react-plugin.