JSPM

gsap-react-plugin

1.0.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 6
  • Score
    100M100P100Q53485F
  • License MIT

A GSAP plugin for tweening React.js component state.

Package Exports

  • gsap-react-plugin

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (gsap-react-plugin) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

GSAP React Plugin

A GSAP plugin for tweening React.js component state.

This plugin will handle tweening values on a prop called state. If the tween target does not have a setState method, the plugin will not initialize.

Usage

React.createClass({
    getInitialState: function() {
        return {width: 0};
    },
    componentDidMount: function() {
        TweenLite.to(this, 1, {state: {width: 100}});
    },
    render: function() {
        return <div style={{width: this.state.width}}>Hello World!</div>
    }
});

Installation