chenglou / react-tween-state

React animation.
Other
1.74k stars 70 forks source link

What should I do when I need to change more than one states at the same time? #54

Open templefox opened 8 years ago

templefox commented 8 years ago

In my case.

   getInitialState: function() {
        return {
            visible: this.props.visible,
            height: -1,
        };
    },

I need the tween to change the height, meanwhile changing the visible too. But I don't want the react refresh the dom twice in this case. Now I just use the anti-pattern way. this.state.visible = !this.state.visible