title: Next.js SWR accessing data from cache
body: <p>I have a problem with accessing data from cache. I have my dahboard component. Data fetching here is ok, and i can access it.</p>
  <pre><code>const Dashboard = ({ code }) =&gt; {
    const { 
      data, 
      error, 
      mutate 
    } = useSWR(['/api/user', code], (url, code) =&gt; api.auth.getAuthData({ code }))
    return (
      &lt;MainLayout&gt;
        &lt;div&gt;
          dasdasdasasd
        &lt;/div&gt;
      &lt;/MainLayout&gt;
    )
  }
  </code></pre>
  <p>The problem starts when i'm trying to access this data in other component.</p>
  <pre><code>const Navbar = () =&gt; {
    const { 
      data, 
      error, 
      mutate 
    } = useSWR(['/api/user'])
    console.log(data)
    return (
      &lt;Styled.Navbar&gt;
        dasdasdas
      &lt;/Styled.Navbar&gt;
    )
  }
  </code></pre>
  <p>Data in navbar component is undefinied. Any reason why this is not working? Whole app is wrapped into  SWR provider.</p>