title: Cannot fetch data from mongo db react native
body: <p>I am brand new to React Native and have just figured out setting up a local server and db for my native app. I am using express and mongodb. I have my server and mongo running on my backend and am trying to make an axios call to get the data from my database but the array is coming back empty and the response from the data is undefined. I have tested the endpoints on postman and the endpoints are fine. Here is an example of my api axios request and the component I am trying to get the data back in.
  Thank you in advanced for your help! Also if you would like to see any other code let me know and I will post it.</p>
  
  <pre><code>// api.js
  
  import axios from "axios";
  
      export const getAllTweets = async () =&gt; {
        await axios
          .get("http://(my ip address):(port number)/api/tweet")
          .then(response =&gt; {
            console.log("response: ", response);
            return response.data;
          })
          .catch(error =&gt; {
            console.log("There are no tweets to get!", error);
          });
      };
  </code></pre>
  
  <p><br></p>
  
  <pre><code>//HomeScreen.js
  
  import React from 'react';
  import {
    Image,
    Platform,
    ScrollView,
    StyleSheet,
    Text,
    TouchableOpacity,
    View,
  } from 'react-native';
  import { WebBrowser } from 'expo';
  
  import { getAllTweets } from '../constants/api';
  
  import { MonoText } from '../components/StyledText';
  
  export default class HomeScreen extends React.Component {
    static navigationOptions = {
      header: null,
    };
    static defaultProps = {
      getAllTweets
    };
    state = {
      tweets: [],
      isLoading: false
    }
  
    async componentDidMount() {
      this.setState({ isLoading: true });
      let data = await this.props.getAllTweets();
      console.log('data: ', data);
      try {
        this.setState({ isLoading: false, tweets: data });
      } catch (error) {
        console.log(error, "Cannot get tweets in cdm");
      }
    }
  
    render() {
      console.log("this.state.tweets", this.state.tweets); &lt;--- this is empty
      return (
        &lt;View style={styles.container}&gt;
  
        &lt;/View&gt;
      );
    }
  
    _maybeRenderDevelopmentModeWarning() {
      if (__DEV__) {
        const learnMoreButton = (
          &lt;Text onPress={this._handleLearnMorePress} style={styles.helpLinkText}&gt;
            Learn more
          &lt;/Text&gt;
        );
  
        return (
          &lt;Text style={styles.developmentModeText}&gt;
            Development mode is enabled, your app will be slower but you can use useful development
            tools. {learnMoreButton}
          &lt;/Text&gt;
        );
      } else {
        return (
          &lt;Text style={styles.developmentModeText}&gt;
            You are not in development mode, your app will run at full speed.
          &lt;/Text&gt;
        );
      }
    }
  </code></pre>