title: Disable prefetch on SWR
body: <p>I am trying to implement swr library for my data fetching. I used to use plain axios and some custom hooks I created.
  The problem I am having is that for some reason, swr is firing the get request before the default axios header is set, thus missing on sending a header that is needed to identify the account for my application.
  My guess is that it has to do with the prefetch capabilities of SWR but that is just a wild guess and don't know how to prevent this from happening.</p>
  <pre><code>import axios from &quot;axios&quot;;
  import React, {useLayoutEffect} from &quot;react&quot;;
  import useSWR from &quot;swr&quot;;
  
  
  function Child({match}) {
      const fetcher = () =&gt; {
          console.log('Should happen second')
          axios.get('https://api.mydomain.com').then(res =&gt; res.data)
      }
  
      const {data} = useSWR('/account/specific/data', fetcher)
  
      return &lt;div&gt;{JSON.stringify(data)}&lt;/div&gt;
  }
  
  export default function Account({match}) {
  
      let accountId = match.params.accountId;
  
      useLayoutEffect(() =&gt; {
          console.log('Should happen first')
          axios.defaults.headers.common[&quot;Account-Token&quot;] = accountId;
      }, [accountId]);
  
      return &lt;Child/&gt;
  }
  </code></pre>