title: ion-textarea resize height dynamically in Ionic 5
body: <p>I am migrating my project from Ionc3 to Ionic5. I have an ion-textarea which increases the height as user types and it works in Ionic3. Following is the code.</p>
  
  <p>HTML page:</p>
  
  <pre><code>&lt;ion-textarea #hvUserPost type="text" (input)="adjustDesc()"&gt;&lt;/ion-textarea&gt;
  </code></pre>
  
  <p>TS page:</p>
  
  <pre><code>@ViewChild('hvUserPost') hvUserPost: ElementRef;
  adjustDesc() {
      let textArea;
      textArea = this.hvUserPost['_elementRef'].nativeElement.getElementsByClassName("text-input")[0];
      textArea.style.overflow = 'hidden';
      textArea.style.height = 'auto';
      var scrollHeight = textArea.scrollHeight;
      textArea.style.height = scrollHeight + 'px';
  }
  </code></pre>
  
  <p>Now in Ionic4 the only thing changes is in the following declaration </p>
  
  <pre><code>@ViewChild('hvUserPost', {static: false}) hvUserPost: ElementRef;
  </code></pre>
  
  <p>In Ionic4, I am getting the following error.</p>
  
  <pre><code>ERROR TypeError: Cannot read property 'nativeElement' of undefined
  </code></pre>
  
  <p>So <code>this.hvUserPost['_elementRef']</code> is undefined and <code>this.hvUserPost.nativeElement</code> is also undefined.</p>