chenglou / react-tween-state

React animation.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

templefox opened this issue · comments

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