title: React Native: How to focus a TextInput wrapped in a custom component?
body: <p>In my React Native app I have a custom component that wraps a <code>TextInput</code>. In the code that uses the custom component, I want to call <code>.focus()</code> on the <code>TextInput</code>. I tried calling it directly on the custom component like this:</p>
  
  <pre><code>&lt;CustomComponent
    ref={ref =&gt; {
      this.customComponent = ref;
    }}
  /&gt;
  
  this.customComponent.focus();
  </code></pre>
  
  <p>but I can't because, I assume, custom components don't have a <code>focus()</code> method. I could find a way to call it on the wrapped <code>TextInput</code>, but I'm wondering if there's a way to call it directly on the custom component.</p>
  
  <p>Does anyone know how I can approach this?</p>