react-shadow-drive-rc
v0.1.22
Published
Simple React Hook/Utils for GenesysGo ShadowDrive
Downloads
6
Readme
React Shadow Drive
A react hook and some helpers/extra typing for GenesysGo's Shadow Drive javascript SDK.
Note: Package API subject to change often in near future
The example app was uploaded via itself to ShadowDrive. So there.
Docs
Setup
Installation
yarn add react-shadow-drive @shadow-drive/sdk
Usage
Checkout the example file management app for full usage info but quick setup would look something like this
const ShadowDriveComponent: FC = () => {
const { ready, refreshStorageAccounts, storageAccounts } = useShadowDrive();
useEffect(() => {
if (!ready) return;
refreshStorageAccounts();
}, [ready]);
return (
<>
{storageAccounts &&
storageAccounts.map(({ acccount, publicKey }) => (
<span key={publicKey.toString()}>{account.identifier}</span>
))}
</>
);
};