title: How do I pass a value from a promise to a component prop in react native?
body: <p>Edit: I don't understand the reason for downvotes, this was a good question and no other questions on this site solved my issue. I simply preloaded the data to solve my issue but that still doesn't solve the problem without using functional components.</p>
  
  <p>I'm trying to pass users last message into the ListItem subtitle prop but I can't seem to find a way to return the value from the promise/then call. It's returning a promise instead of the value which gives me a "failed prop type". I thought about using a state but then I don't think I could call the function inside the ListItem component anymore.</p>
  
  <pre><code>  getMsg = id =&gt; {
      const m = fireStoreDB
        .getUserLastMessage(fireStoreDB.getUID, id)
        .then(msg =&gt; {
          return msg;
        });
      return m;
    };
  
    renderItem = ({ item }) =&gt; (
      &lt;ListItem
        onPress={() =&gt; {
          this.props.navigation.navigate('Chat', {
            userTo: item.id,
            UserToUsername: item.username
          });
        }}
        title={item.username}
        subtitle={this.getMsg(item.id)} // failed prop type
        bottomDivider
        chevron
      /&gt;
    );
  </code></pre>