I am trying to implement share point file browser in my react application. Using microsoft/file-browser
for this ans code as follows. But getting the xxx... from origin 'http://localhost:3000' has been blocked by CORS policy
Any ideas how can I enable CORS for this
import * as React from "react";
import { GraphFileBrowser } from '@microsoft/file-browser';
class App extends React.Component {
getAuthenticationToken() {
return new Promise<string>(resolve => {
resolve(
"VALID TOKEN"
);
});
}
render() {
return (
<GraphFileBrowser
getAuthenticationToken={this.getAuthenticationToken}
onSuccess={(selectedKeys: any[]) => console.log(selectedKeys)}
onCancel={(err: Error) => console.log(err.message)}
endpoint='https://XXX.sharepoint.com'
/>
);
}
}
export default App;