Renders the file field of the dump forms, a FileDropZone bound to react-hook-form.
f
FileField<T extends FieldValues>(unnamed 0: FileFieldProps<T>): React.JSX.Element
Renders the drop zone with its label and the field's error. It must sit under
a react-hook-form FormProvider, such as one given useApiForm's result.
I
FileFieldProps
Passed to FileField by a dump form. The field it names holds the
File itself, or null.
- disabled: boolean
- hint: string
- label: string
-
maxBytes: number
Refuses a larger file, as a field error, as soon as it is picked.
- name: Path<T>
-
onValueChange: (file: File | null) => void
Called after the form's value is set, for a side effect such as deriving the title from the file's name.
- rules: RegisterOptions<T, Path<T>>
-
showLimit: boolean
States
maxBytesin the drop zone.
Usage
import * as mod from "src/components/form/FileField.tsx";