Build a React.js Microsoft OneDrive API FilePicker to Download & Upload Files to Storage in Browser Using Javascript Full Project For Beginners

 

 

npm i react-onedrive-filepicker

 

 

 

index.js

 

 

import React from "react";
import "./styles.css";
import { ReactOneDriveFilePicker } from "react-onedrive-filepicker";

export default function App() {
  return (
    <div className="App">
      <ReactOneDriveFilePicker
        clientID="c3e71009-3dd7-4fc8-9127-2de5ac14c89f"
        action="share"
        multiSelect={true}
        onSuccess={(result) => {
          alert(JSON.stringify(result));
        }}
        onCancel={(result) => {
          alert(JSON.stringify(result));
        }}
      >
        <button>Click Here</button>
      </ReactOneDriveFilePicker>
      <h1>Hello CodeSandbox</h1>
      <h2>Start editing to see some magic happen!</h2>
    </div>
  );
}

Leave a Reply