title: Receiving a CORS error when to my react app using fetch function
body: <p>I received the dreaded CORS error when hooking up my API. I am using the BeerDB one. I tried the plugin, adding the header, going into <code>index.js</code> but it does not seem to solve it. Still looking into it, my code for my <code>App.js</code> is below. It is a React app.</p>
  
  <p>The next thing I can even think of is to refactor my API fetch call to use <code>axios</code> and use different syntax than currently being used. </p>
  
  <pre class="lang-js prettyprint-override"><code>import React, {useEffect, useState, Component} from 'react';
  import './App.css';
  import Beer from './Beer.js';
  
  const App = () =&gt; {
  
    const App_Key = "b1322de05886eaf6bdd71b64c52d12b7"
  
    const [beers, setBeers] = useState([]);
  
    useEffect (() =&gt; {
      getBeers();
     }, []);
  
    const getBeers = async () =&gt; {
      const response = await fetch("http://api.brewerydb.com/v2/?key=b1322de05886eaf6bdd71b64c52d12b7");
      const data = await response.json();
      console.log(data); 
    }
  
    return(
      &lt;div className="App"&gt;  
        &lt;form&gt;
          &lt;input type="text" &gt;&lt;/input&gt;
          &lt;button type="submit"&gt;Search&lt;/button&gt;
        &lt;/form&gt;
  
      { beers.map(beers =&gt; (&lt;Beer /&gt; )) }
  
      &lt;/div&gt;
    );
  }
  
  export default App;
  </code></pre>