chenglou / chenglou/react-tween-state

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

Open
#54 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
1.7k
Forks
70
PR merge metrics
No merged PRs in 30d

Description

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`

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.