Skip to content

React Native

This page covers how the library handles platform differences on React Native, the FileRef type, and the component API.

The adapter packages use the .native.ts convention. Metro resolves foo.js to foo.native.ts when bundling for iOS/Android.

ModuleWebNative
adapter/hyperserveXHR with progress eventsreact-native-background-upload with fallback to fetch
platform/fileRefFileFileRef with rawDocumentPickerResultFileRef with uri
platform/thumbnailURL.createObjectURLexpo-video-thumbnails or null
validation/maxDurationDOM video elementexpo-video-metadata (skips if missing)

FileRef is a discriminated union on platform:

type WebFileRef = { platform: "web"; uri: string; name: string; size: number; type: string; raw: File };
type NativeFileRef = { platform: "native"; uri: string; name: string; size: number; type: string };

On native, raw is not available; the adapter uses the uri directly.

The native UI package mirrors the web package:

WebNative
DropZoneFilePicker
FileListFileList (uses FlatList, supports numColumns)
FileItem + sub-componentsSame compound component API
FileListToolbarSame API
ThumbnailRenders Image (no built-in playback)