title: How to set parent view's height based on subview's height
body: <p>I want to write a customized parent <code>View</code> which includes either one <code>Text</code> componet subView or two <code>Text</code> component subViews. Is there a way to set the parent <code>View</code>'s height based on the <code>Text</code> view's height?</p>
  
  <pre><code>class ParentView extends Component {
    constructor(props) {
      super(props);
    }
  
    render() {
      const {
        titleText,
        bodyText,
      } = this.props;
  
      //if titleText is passed to props, measure it's height; 
      //if bodyText is passed to props, measure it's height;
      // set contentContainer height = titleText + bodyText + someMargin
      return (
        &lt;View style={styles.contentContainer}&gt;        
          {titleText &amp;&amp; &lt;Text style={styles.title}&gt;
            {titleText}
          &lt;/Text&gt;}
          {bodyText &amp;&amp; &lt;Text style={styles.body}&gt;
            {bodyText}
          &lt;/Text&gt;}
        &lt;/View&gt;
      );
    }
  }
  </code></pre>