title: Configure Base Url in Axios with React Typescript
body: <p>how can I set up my baseURL in axios with React Typescript?</p>
  <p>I tried doing <code>axios.defaults.baseURL = 'myurl.com';</code></p>
  <p>But, it's not working. In the network tab, it says that the promise is pending.</p>
  <p>Any idea how can I achieve it?</p>
  <pre><code>import { useQuery } from 'react-query'
  import axios from 'axios'
  
  axios.defaults.baseURL = 'myurl.com';
  
  
  const useCampaign = (token: string, campaignID: string) =&gt;
    useQuery(
      'campaign',
      () =&gt;
        axios
          .get(`/api/campaigns?lgp-webview-token=${token}`, {
            headers: { 'X-Campaign-ID': campaignID }
          })
          .then((res) =&gt; res.data),
      {
        retry: false,
        refetchOnWindowFocus: false
      }
    )
  
  export default useCampaign
  
  </code></pre>