title: Expo : How can I fetch data from Django Rest Framework API?
body: <p>I'm using Expo 5.0.1.
  I have an API which works fine.</p>
  <p>Here is my entire App.js :</p>
  <pre><code>import React, { useState, useEffect } from 'react';
  import { StyleSheet, Text, View, FlatList } from 'react-native';
  
  const [data, setData] = useState([{title: &quot;First title&quot;}]);
  
    useEffect(() =&gt; {
      fetch('http://192.168.1.68:89/cards/', {
        method: &quot;GET&quot;
      })
      .then(resp =&gt; resp.json())
      .then(data =&gt; {
        console.log(data)
      })
      .catch(error =&gt; console.log(&quot;Error is : &quot;, error))
    }, [])
  
  const renderData = (item) =&gt; {
    return(
      &lt;View style={styles.view}&gt;
        &lt;Text&gt;{item.user}&lt;/Text&gt;
        &lt;Text&gt;{item.is_suspended}&lt;/Text&gt;
        &lt;Text&gt;{item.id}&lt;/Text&gt;
      &lt;/View&gt;
    ) 
  }
  
  export default function App() {
  
    return (
      &lt;View style={styles.view}&gt;
        &lt;FlatList
        data = {data}
        renderItem={({item}) =&gt; {
          return renderData(item)
        }}
        keyExtractor={item =&gt; item.user}
        /&gt;      
      &lt;/View&gt;
    );
  }
  
  const styles = StyleSheet.create({
    Bold: {fontWeight: '600',},
    Red: {color: 'red'}, 
    px30: {fontSize: '20px',},
    view: {justifyContent: 'center', textAlign: 'center', paddingTop: '20px',},
  })
  </code></pre>
  <p>I can't even get the error from my '.catch'.
  Here is the error:
  <a href="https://i.stack.imgur.com/WCAJz.png" rel="nofollow noreferrer">Error1</a></p>
  <p>And here is when I put useEffect code into function app :
  <a href="https://i.stack.imgur.com/6SzpL.png" rel="nofollow noreferrer">Error2</a></p>
  <p>Someone can help me with get data from Rest Api?</p>