title: How to use MSAL-React with class component?
body: <p>Am using <a href="https://www.npmjs.com/package/@azure/msal-react" rel="nofollow noreferrer">https://www.npmjs.com/package/@azure/msal-react</a> in my react project. The library provides hooks to perform auth very easliy.</p>
  <p>So in functional component, for getting access token,</p>
  <pre><code>if (account &amp;&amp; inProgress === &quot;none&quot;) {
  instance.acquireTokenSilent({
  ...loginRequest,
  account: account
  }).then((response) =&gt; {
  callMsGraph(response.accessToken).then(response =&gt; setGraphData(response));
  });
  }
  </code></pre>
  <p>needs to be called where <code>const { instance, accounts, inProgress } = useMsal();</code> is used.</p>
  <p>But I need to call api to fetch data from class components.
  So, how to achieve the same functionality in class component</p>