DriveLoader Logo
DriveLoaderv1.2.0
Docs/Custom React Hooks

Custom React Hooks

Programmatic state control with useDriveImage, useDriveVideo, and useDriveAudio.

Overview

Exposes full resolution lifecycle, errors, media controls, and extracted metadata directly to your custom React components.

Code Example

hooks.tsx
1import { useDriveVideo } from '@driveloader/react';
2
3const { videoUrl, loading, error, metadata } = useDriveVideo(url);

Best Practices

  • Use hooks when you need to build entirely custom UI elements (like a bespoke video player controls bar).