azazdeaz / react-gsap-enhancer

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

use together with other HOC? #29

Closed badtant closed 8 years ago

badtant commented 8 years ago

Hi, I'm trying to use GSAP together with another HOC. In this case connect from react-redux. Using es6. However I can't get it to work.

import GSAP from 'react-gsap-enhancer';
import { connect } from 'react-redux';

class MyComponent extends React.Component {
  render() {/*...*/}
}

const map = (state) => ({
  countdown: state.countdown
});

export default GSAP(connect(map)(MyComponent));

Am I doing this wrong?

azazdeaz commented 8 years ago

I'm not sure what are you experiencing but probably changing the HoC order will fix the issue. like:

export default connect(map)(GSAP(MyComponent))
badtant commented 8 years ago

That made the connect work, but when trying to add an animation utils.target is empty so I cant use the find methods.

azazdeaz commented 8 years ago

That sounds weird, can you show the code that does this?

badtant commented 8 years ago

Set up a codepen with similar code but of course it works there... http://codepen.io/anon/pen/JRZByV

Gah, can't understand this :)

badtant commented 8 years ago

Finaly got it working... Typo from my side.