React-Motion(https://github.com/chenglou/react-motion)を使用して実際にパフォーマンスが低下しています。テーブル行のドロップダウンの高さを0
から260
にアニメートしています。アニメーションごとのリアクションモーションレンダリング
constructor() {
this.state = {
opened: false
}
this.handleRowClick = this.handleRowClick.bind(this)
}
handleRowClick() {
this.setState({
opened: !this.state.opened
})
}
render() {
<Motion style={{height: spring(this.state.opened ? 260 : 0, {stiffness: 140, damping: 30})}}>
{(height) =>
<div onClick={this.handleRowClick}>
<div style={height}>
...stuff goes here
</div>
</div>
}
</Motion>
}
アニメーションが期待どおりに動作しますが、高さに、それは〜5秒(WAY長すぎる)のスパンでこのすべてをレンダリングするたびにログインするときにされています
たぶん私は読み違えますドキュメント内には何かがありますが、アニメーションの遅れを避ける方法はありますか?