Skip to content

Commit

Permalink
Fix #175 'Content is laid out repeatedly during expand animation' (#180)
Browse files Browse the repository at this point in the history
* Fix #175 'Content is laid out repeatedly during expand animation'

* Format code using Prettier
  • Loading branch information
andriichernenko authored and iRoachie committed May 15, 2018
1 parent ba349c6 commit 85651da
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Collapsible.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { Animated, Easing } from 'react-native';
import { Animated, Easing, View } from 'react-native';
import { ViewPropTypes } from './config';

const ANIMATED_EASING_PREFIXES = ['easeInOut', 'easeOut', 'easeIn'];
Expand Down Expand Up @@ -198,7 +198,9 @@ export default class Collapsible extends Component {
style={[this.props.style, contentStyle]}
onLayout={this.state.animating ? undefined : this._handleLayoutChange}
>
{this.props.children}
<View style={{ height: measured ? contentHeight : null }}>
{this.props.children}
</View>
</Animated.View>
</Animated.View>
);
Expand Down

0 comments on commit 85651da

Please sign in to comment.