title: React component to access sharepoint
body: <p>I am trying to build a component that user can browse files from share point online.</p>
  
  <p>I did search but they are mainly about creating share point web parts. Found something called <a href="https://www.npmjs.com/package/@microsoft/file-browser" rel="nofollow noreferrer">GraphFileBrowser</a> but did not had luck with it.</p>
  
  <p>I can browse this url <code>https://domain.sharepoint.com/folder1/folder2/Documents/Forms/AllItems.aspx</code> in my browser. Trying to point the file browser to same place</p>
  
  <hr>
  
  <pre><code>import React from 'react';
  import { GraphFileBrowser } from '@microsoft/file-browser'; 
  
  class FileBrowser extends React.Component {
    getAuthenticationToken() {
      return new Promise&lt;string&gt;(resolve =&gt; {
        resolve(
          "token"
        );
      });
    }
  
    render() {
      return (
        &lt;GraphFileBrowser
          getAuthenticationToken={this.getAuthenticationToken}
          endpoint='https://domain.sharepoint.com/folder1/folder2/Documents/Forms/AllItems.aspx'
        /&gt;
      );
    }
  }
  
  export default FileBrowser;
  </code></pre>
  
  <p>In network tab I can see it trying to connect </p>
  
  <p><code>https://domain.sharepoint.com/folder1/folder2/Documents/Forms/AllItems.aspx/drive/items/</code></p>
  
  <p>Seems to be appending <code>/drive/items/</code> at the end somehow</p>
  
  <p>Give me below error as well</p>
  
  <pre><code>file-browser_en-us.js:47237 Uncaught SyntaxError: Unexpected token &lt; in JSON at position 2
      at Object.parse (&lt;anonymous&gt;)
      at file-browser_en-us.js:47237
      at Object.m [as _notify] (file-browser_en-us.js:4981)
      at Object.enter (file-browser_en-us.js:5192)
      at e._run (file-browser_en-us.js:5487)
      at e._completed (file-browser_en-us.js:5469)
      at e._callSuccessCallback (file-browser_en-us.js:47440)
      at e._requestEndCallback (file-browser_en-us.js:47465)
      at XMLHttpRequest.d.onreadystatechange (file-browser_en-us.js:47399)
  </code></pre>
  
  <p>Not sure is this the right way to implement such a thing. Any direction on this please</p>