title: Using Aysnc/await with Props
body: <p>I want to use async and await with props. </p>
  
  <p>So basically I have a onRefresh function which refreshes when user scrolls down. </p>
  
  <p>Here, i want to change the state to false once my reducer have successfully updated the data </p>
  
  <pre><code>onRefresh = () =&gt; {
          this.setState({isFetching: true}, () =&gt; {
              refreshData = async () =&gt; {
              await this.props.indianCurrency()
              await this.props.exchangeToDisplay(this.coinURL, true)
              await  this.setState({isFetching: false})
              }
          })
  
      } 
  </code></pre>
  
  <p>In await <code>this.props.indianCurrency()</code>  action I have added a <code>console.log</code> statement to see if it is being executed it or not. </p>
  
  <p>This is my action for indianCurrency </p>
  
  <pre><code>export const indianCurrency = () =&gt; {
    console.log("inside Indian currency")
    return function (dispatch) {
      dispatch({type: CURRENCY_FETCHING})
      axios.get(CurrencyRateLinkINR).then((response) =&gt; {
        return (
          dispatch({
            type: CURRENCY_INR,
            payload: response.data
          })
        )
      }).catch((error) =&gt; {
        return (
          dispatch({
            type: CURRENCY_ERROR,
            payload: error.data
          })
        )
      })
    }
  }
  </code></pre>
  
  <p>and for exchangeToDisplay my action looks like this </p>
  
  <pre><code>export const exchangeToDisplay = (exchangURL, random) =&gt; {
      console.log(random)
      console.log("on Refresh check as well")
      return function (dispatch) {
              if (random == undefined) {
                 dispatch({type: EXCHANGE_CURRENCY_FETCHING })
               }
              let koinexApi = axios.get(koinex)
              let coinDeltaApi = axios.get(coinDelta)
              let multipleExchangeDataApi = axios.get(multipleExchangeData + exchangURL + "-usd") 
              Promise.all([koinexApi, coinDeltaApi , multipleExchangeDataApi]).then(function(values) {
                  return(
                      dispatch({
                          type: EXCHANGE_CURRENCY_FETCH_SUCCESS,
                          payload: values
                      })
                   )   
              }).catch((error) =&gt; {
                  return (
                      dispatch({
                          type: EXCHANGE_CURRENCY_FETCH_ERROR,
                          payload: error
                      })
                  )
               })
      }
  }
  </code></pre>
  
  <p>And for my surprise nothing isn't logging out there. So I have reason to believe that I am not using async/await correctly here? So can someone guide me on how to use async and await correctly? </p>
  
  <p><strong>Note:</strong> I am purposely not pasting <code>reducer code</code> and  because I believe that problem happens to be in my async/await since it isn't even running <code>export const indianCurrency = () =&gt; {</code> if in case it is required then do let me know and I will paste it.</p>