Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Any way to use as an ES6 super class? #26

Open
guncha opened this issue Oct 10, 2016 · 0 comments
Open

Any way to use as an ES6 super class? #26

guncha opened this issue Oct 10, 2016 · 0 comments

Comments

@guncha
Copy link

guncha commented Oct 10, 2016

The library would be much easier to use with Typescript if it was possible to use it as a super class. E.g.,

import {GSAPComponent} from "react-gsap-enhancer"

class MyComponent extends GSAPComponent {
  componentDidMount(prevProps, prevState) {
    super.componentDidMount(prevProps, prevState)
    this.myController = this.addAnimation(...)
  }
  render() {
    // I understand that the enhancer render function needs to add refs, so
    // perhaps the API can be something like this:
    super.render(() => {
      // the usual render function business..
      return <div... />
    })
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant