title: Simple GET request in React is not working for api call using fetch
body: <p>I am using newsapi to fetch news in <code>React</code> with <code>fetch(url)</code> method but at the end it returns nothing and I am not able to figure out what I am missing, since it does not show any error. My <code>React</code> code to <code>fetch</code> the json data is as below.</p>
  <pre><code> import React, { Component } from &quot;react&quot;
      
      
      class App extends Component{
        constructor(props){
          super(props);
          
          this.state ={
            totalNewsResults : null
          };
        }
      
        componentDidMount() {
          fetch(url)
              .then(response =&gt; response.json())
              .then(data =&gt; this.setState({ totalNewsResults: data.totalResults }));
      }
        render(){
          const { totalNewsResults } = this.setState;
          return(
            &lt;div&gt;
              Total News results : {totalNewsResults}
            &lt;/div&gt;
          );
        }
      }
      
      export default App
  </code></pre>
  <p>Any help will be appreciated.</p>
  <p>Thanks</p>