title: Why is a function not awaited as a promise?
body: <p>I have a component MicButtons.js which exports a promise</p>
  <pre class="lang-js prettyprint-override"><code>import Voice from 'react-native-voice'
  export const MicButton = async () =&gt; {
    Voice.start('en-US')
    Voice.onSpeechResults = async (res) =&gt; { 
      res = await JSON.parse(JSON.stringify(res)).value[0] 
      return res
    }
  }
  </code></pre>
  <p>And when I try to use it in another component, await doesn't work and alert shows &quot;undefined&quot;</p>
  <pre class="lang-js prettyprint-override"><code>import MyButton from '../components/MyButton';
  import { MicButton } from '../components/MicButton';
  //...
  &lt;MyButton h=&quot;80%&quot; w=&quot;50%&quot; srcImg={mic} func={async() =&gt; {
    let command = await MicButton()
    alert(command)           
  }}&gt;&lt;/MyButton&gt;
  </code></pre>
  <p>This is how <code>MyButton</code> component looks like:</p>
  <pre class="lang-js prettyprint-override"><code>import React from 'react';
  import PropTypes from 'prop-types'
  import { Text, View, TouchableOpacity, ImageBackground } from 'react-native';
  
  const MyButton = ({ text=&quot;&quot;, h, w, srcImg, func=()=&gt;{} }) =&gt; {
  
    return (
      &lt;View style={{height: h, width: w}}&gt;
        &lt;TouchableOpacity style={{ height: '100%', width: '100%'}} onPress={func}&gt;
          &lt;ImageBackground source={srcImg} style={{flex: 1}}&gt;
  
            &lt;Text&gt;{text}&lt;/Text&gt;
  
          &lt;/ImageBackground&gt;       
        &lt;/TouchableOpacity&gt;
      &lt;/View&gt;
    )
  }
  
  MyButton.PropTypes = {
    text: PropTypes.string,
    h: PropTypes.number,
    w: PropTypes.number,
    srcImg: PropTypes.object,
    func: PropTypes.func
  }
  
  export default MyButton
  </code></pre>