title: How can a react-native component be rendered inside a fetch success response?
body: <p>I'm trying to display a badge with the number of properties of each property type. The data from the API is received, but the Badge component doesn't render.  </p>
  
  <pre><code>countProp = (id) =&gt; {
  
      fetch('http://10.0.2.2:8000/api/property/' + id).then((data) =&gt; data.json())
  
  .then((response) =&gt; {
  
                  ```return &lt;Badge value={response.properties.length}/&gt;
  
              });
      };
  </code></pre>
  
  <p>Thereafter the below function is called inside this <code>renderItem</code> method which serves as an array iterator to render the property types:</p>
  
  <pre><code> renderItem = ({item}) =&gt; {
  
     return(
  
      &lt;View&gt;  
      ....
  
      ```{this.countProp(item.id)}
  
      &lt;/View&gt;
  
      )
  
    }
  </code></pre>