azazdeaz/react-gsap-enhancer

redux 'connect' and GSAP

juanzone opened this issue · 2 comments

Hello,

How can I use react-gsap-enhancer with redux in my react component?
When i export my class with 'connect' for redux how can I put GSAP?

exemple: 'export default connect(mapStateToProps, mapDispatchToProps)(Component)'

Thanks :)

When using multiple higher order components we use the compose helper from redux where I work.

import { compose } from 'redux'

export default compose(
  connect(mapStateToProps, mapDispatchToProps),
  GSAP(),
)(MyComponent)

You could also just do the composing manually instead

export default connect(mapStateToProps, mapDispatchToProps)(GSAP()(MyComponent))

Thanks for the help mate!
I'll use the compose helper ;)