azazdeaz / react-gsap-enhancer

Use the full power of React and GSAP together
MIT License
727 stars 38 forks source link

Is it possible to use gsap plugins? #17

Closed abelovic closed 8 years ago

abelovic commented 8 years ago

I would like to use the throwPropsPlugin/Draggable. How would I do this?

zaklampert commented 8 years ago

+1

azazdeaz commented 8 years ago

I have no experience with ThrowPropsPlugin or Draggable, if anyone has an example for this, please share with us :)

benstepp commented 8 years ago

We are using Draggable with webpack in our of our projects. Relevant config changes include aliasing off the expected dependencies in webpack.config.js.

// somewhere in code
require('gsap')
if (typeof window !== 'undefined') require('gsap/src/uncompressed/utils/Draggable')
Draggable.create(/* ... */)

// webpack.config.js
{
  resolve: {
    alias: {
      TweenLite: 'gsap',
      CSSPlugin: 'gsap/src/uncompressed/plugins/CSSPlugin'
  }
}