useDropboxAuth
useDropboxAuth():
DropboxAuthContextValue
Defined in: src/react/useDropboxAuth.ts:228Â
Hook to access Dropbox authentication state and methods.
Must be used within a DropboxAuthProvider.
Returns
Example
import { useDropboxAuth } from "@reverbia/sdk/react";
function DropboxButton() {
const { isAuthenticated, isConfigured, requestAccess, logout } = useDropboxAuth();
if (!isConfigured) {
return <p>Dropbox not configured</p>;
}
if (isAuthenticated) {
return <button onClick={logout}>Disconnect Dropbox</button>;
}
return <button onClick={requestAccess}>Connect Dropbox</button>;
}Last updated on