@breadhead/react-file-uploader
TypeScript icon, indicating that this package has built-in type declarations

2.0.4 • Public • Published

react-file-uploader

Instalation

yarn add --dev @breadhead/react-file-uploader

Usage

import * as React from "react";
import { Uploader } from "@breadhead/react-file-uploader";

  <Uploader
    id="my-uploader"
    uploadFile={(file: File, onProgress?: onProgress) => Promise<UploadedFile>}
    onError={(err: Error) => void}
    onUploaded={(url: string) => void}
  >
    {({ path, uploading, progress }: RenderProps) => (
      <>
        <ProgressBar progress={progress} />
        {!!uploading && <p>file is uploaded from {path}</p>}
      </>
    )}
  </Uploader>

  interface RenderProps {
    path: string
    uploading: boolean
    progress: number
  }

Package Sidebar

Install

npm i @breadhead/react-file-uploader

Weekly Downloads

1

Version

2.0.4

License

MIT

Unpacked Size

10.7 kB

Total Files

23

Last publish

Collaborators

  • igor.kamyshev
  • iwanttobealight
  • uncleseneca