title: React Native - show data from an API in a <Text>
body: <p>I'm using <code>fetch()</code> to get data from an external data and want to display it in my <code>View</code>.</p>
  
  <p><code>console.log(responseJson)</code> is displaying data from the API, but <code>this.state.data</code> in my <code>&lt;Text&gt;</code> is not showing it.</p>
  
  <p>All shown in my app is "Temperatur: C".</p>
  
  <p>Not getting any errors when I'm running it.</p>
  
  <p>Is my <code>this.state.data</code> not the correct way to show it?</p>
  
  <pre><code>import React, { Component } from 'react'
  import { StyleSheet, Text, View, Image, Button, Alert } from 'react-native';
  
  
  class Wether extends Component {
      state = {
         data: ''
      }
      componentDidMount = () =&gt; {
         fetch('https://opendata-download-metfcst.smhi.se/api/category/pmp2g/version/2/geotype/point/lon/16/lat/58/data.json',{
            method: 'GET'
         })
         .then((response) =&gt; response.json())
         .then((responseJson) =&gt; {
            console.log(responseJson);
  
            this.setState({
               data: responseJson
            })
         })
         .catch((error) =&gt; {
            console.error(error);
         });
      }
      render() {
         return (
            &lt;View&gt;
               &lt;Text&gt;
                  Temperatur: {this.state.data} C
               &lt;/Text&gt;
            &lt;/View&gt;
         )
      }
   }
   export default Wether
  </code></pre>
  
  <p>My console.log(responseJson) shows:</p>
  
  <pre><code>Object {
         "parameters": Array [
           Object {
             "level": 0,
             "levelType": "hmsl",
             "name": "msl",
             "unit": "hPa",
             "values": Array [
               1005,
             ],
           },
  </code></pre>