diff --git a/Collapsible.js b/Collapsible.js index fb3cbb5..e089fcd 100644 --- a/Collapsible.js +++ b/Collapsible.js @@ -26,12 +26,6 @@ export default class Collapsible extends Component { }; } - componentDidMount() { - if (!this.props.collapsed) { - this._measureContent((height) => this.state.height.setValue(height)); - } - } - componentDidUpdate(prevProps) { if (prevProps.collapsed !== this.props.collapsed) { this.setState({ measured: false }, () => @@ -194,7 +188,7 @@ export default class Collapsible extends Component { const hasKnownHeight = !measuring && (measured || collapsed); const style = { overflow: 'hidden', - height: hasKnownHeight ? height : 0, + height: hasKnownHeight ? height : 'unset', }; const contentStyle = {}; if (measuring) {