title: Data not loaded when API CALL made using fetch() function in REACTJS
body: <p>I have tried to make an apicall with react code and tried to print the response but it shows error
  react code</p>
  <pre><code>
      import React,{Component} from 'react'
      
      class ApiCall extends Component 
      {
          constructor(props)
          {
              super(props);
              this.state=
              {
                  items:[],
                  isloaded:false,
              }
          }
      
          componentDidMount()
          {
              fetch('api.openweathermap.org/data/2.5/weather?q=chennai&amp;appid=e407e5e8......')
              .then(res=&gt;res.json())
              console.log(res.json())
              .then(json=&gt;{
                   this.setState({
                       isloaded:true,
                       items: json,
                   })
              });
          }
      
          render()
          {
              var{isloaded,items}=this.state;
      
              if(!isloaded)
              {
                  return &lt;div&gt;Loading..&lt;/div&gt;;
              }
              else
              {
              return(
                  &lt;div&gt;
                     Data Loaded
                     &lt;ul&gt;
                         {items.map(item=&gt;(
                             &lt;li key={item.id}&gt;
                                 Title: {item.title  }
                                 Body:{item.body}
                             &lt;/li&gt;
                         ))};
                     &lt;/ul&gt;
                  &lt;/div&gt;
              )
              }
          }
      }
      
      export default ApiCall;
  
  </code></pre>
  <p>inside app.js</p>
  <pre><code>
      class App extends Component 
      {
        render()
        {
          return(
            &lt;div className=&quot;App&quot;&gt;
              &lt;ApiCall/&gt;
            &lt;/div&gt;
          )
        }
      }
  
  </code></pre>
  <p>**folder structure:
  project:<br />
  src:<br />
  App.js<br />
  components:<br />
  apicall.js
  **</p>
  <p><strong>I got an error in the browser saying,
  Failed to compile
  src\components\apicall.js
  Line 20:21:  'res' is not defined  no-undef</strong></p>
  <p><strong>Note:The link inside fetch() is taken from openweather website</strong></p>
  <p>Can somebody help me with this?</p>