React API
Source-generated reference for the React bindings.
@upload-stuff/react wraps the framework-free client engine in hooks. Tables
are generated from the package source, so they match the shipped API.
createUploadStuffReactHelpers
const { useUploadStuff, useRouteConfig } = createUploadStuffReactHelpers(client);Binds a typed UploadStuffClient to a pair of hooks.
Call it once (usually in a shared module) and export the returned hooks so every
component shares the same client.
useUploadStuff
useUploadStuff(endpoint, options?): UseUploadStuffReturnThe primary upload hook. endpoint is a key of your file router (or an
EndpointArg resolver); options are the callbacks and per-hook settings below.
UseUploadStuffOptions
Prop
Type
UseUploadStuffReturn
Prop
Type
StartUploadFnOptions
Per-call options for the returned startUpload function.
Prop
Type
useRouteConfig
useRouteConfig(endpoint): { data, error, isLoading, refetch }Fetches and caches a single route's normalized config. A failed refresh keeps
serving the config already loaded; only a first load surfaces error. Call
refetch() to force a fresh fetch after the route's config changes server-side.