title: REACT.js variables not accepted in api request
body: <p>I'm trying to make my code more efficient and reusable by adding variables on my requests and console.log. But for some reason its not working and I can't figure out why! full code can be found at: <a href="https://codesandbox.io/s/wispy-lake-6h051" rel="nofollow noreferrer">https://codesandbox.io/s/wispy-lake-6h051</a></p>
  <p>This works:</p>
  <pre><code>  state = {
      lastWeek: '2020-11-09',
      today: '2020-11-12',
      selectedBase: 'USD',
      firstDateValues: null,
      fifthDateValues: null
    };
  
    getAPI = async() =&gt; {
      const START_DATE = this.state.lastWeek;
      const END_DATE = this.state.today;
      const BASE = this.state.selectedBase;
      
      const response = await fixer.get(`?start_at=${START_DATE}&amp;end_at=${END_DATE}&amp;base=${BASE}`, {
      });
      console.log(BASE) ---&gt; output: USD
      console.log(response.data.rates[START_DATE].USD) --&gt; correct data
  }
  
  </code></pre>
  <p>But this doesn't:</p>
  <pre><code>  state = {
      lastWeek: '2020-11-09',
      today: '2020-11-12',
      selectedBase: 'USD',
      firstDateValues: null,
      fifthDateValues: null
    };
  
    getAPI = async() =&gt; {
      const START_DATE = this.state.lastWeek;
      const END_DATE = this.state.today;
      const BASE = this.state.selectedBase;
      
      const response = await fixer.get(`?start_at=${START_DATE}&amp;end_at=${END_DATE}&amp;base=${BASE}`, {
      });
      console.log(BASE) ---&gt; output: USD
      console.log(response.data.rates[START_DATE].BASE) --&gt; output: undefined 
  }
  
  </code></pre>
  <p>Why?</p>