title: Call component through function React Native
body: <p>I'm developing a <code>component</code> to publish it in <code>npm</code>, but I'd like to call my component using a <code>method</code> instead of a tag.</p>
  
  <p>Example:</p>
  
  <p><strong>myComponent.js</strong></p>
  
  <pre><code>import React from 'react'
  import { View, Text } from 'react-native'
  
  export const showComponent = () =&gt; {
      // this would be the function that I user to call my component down
  }
  
  const myComponent = (props) =&gt; {
      return(
          &lt;View&gt;
              &lt;Text&gt;Oi&lt;/Text&gt;
          &lt;/View&gt;
      )
  }
  </code></pre>
  
  <p><strong>App.js</strong></p>
  
  <pre><code>import React from 'react'
  import { View, Text, TouchableOpacity } from 'react-native'
  import { showComponent } from 'my-component'
  
  const App = () =&gt; {
      return(
          &lt;View&gt;
              &lt;TouchableOpacity onPress={() =&gt; showComponent()}&gt;
                  &lt;Text&gt;Home&lt;/Text&gt;
              &lt;/TouchableOpacity&gt;
          &lt;/View&gt;
      )
  }
  
  export defaul App
  </code></pre>
  
  <p>the idea is that when calling the <code>showComponent</code> function I show my component, and when I call, for example, the <code>hide</code> function, I close my component.</p>