Skip to content
Reusable React input file component.
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.storybook fix(storybook): addon.js -> addons.js Dec 24, 2018
flow-typed/npm chore(deps): ncu update Feb 11, 2019
src feat: add an option for multiple files upload (#113) Mar 8, 2019
.editorconfig feat: init Jan 29, 2018
.eslintignore refactor: add esmodule & use react.createRef & update dev env (#45) Dec 10, 2018
.flowconfig refactor: add esmodule & use react.createRef & update dev env (#45) Dec 10, 2018
.gitignore refactor: add esmodule & use react.createRef & update dev env (#45) Dec 10, 2018
.nvmrc chore(deps): ncu update Feb 11, 2019
.prettierignore refactor: add esmodule & use react.createRef & update dev env (#45) Dec 10, 2018
.prettierrc.js refactor: add esmodule & use react.createRef & update dev env (#45) Dec 10, 2018
.travis.yml chore(deps): ncu update Feb 11, 2019
CHANGELOG.md
LICENSE chore(deps): ncu update Feb 11, 2019
README.md feat: add an option for multiple files upload (#113) Mar 8, 2019
index.d.ts feat: init Jan 29, 2018
package.json 1.2.0 Mar 8, 2019
renovate.json feat: init Jan 29, 2018
setupTests.js refactor: add esmodule & use react.createRef & update dev env (#45) Dec 10, 2018
yarn.lock chore(deps): update dependency enzyme-adapter-react-16 to v1.10.0 (#106) Feb 26, 2019

README.md

react-input-files

Reusable React input file component.

Travis Codecov Status npm package npm downloads

prettier license

Installation

$ yarn add react-input-files

Demo

Usage

import InputFiles from 'react-input-files';

<InputFiles onChange={files => console.log(files)}>
  <button>Upload</button>
</InputFiles>;

API

type Props = {
  children: React.Node,
  onChange: (files: Array<File>, e: SyntheticEvent<HTMLInputElement>) => void,
  accept?: string,
  style?: Object,
  multiple?: boolean,
};

Development

Requirements

  • node >= 11.9.0
  • yarn >= 1.13.0
$ yarn install --pure-lockfile
$ yarn start

Test

$ yarn run format
$ yarn run eslint
$ yarn run flow
$ yarn run test:watch
$ yarn run build

Publish

$ npm version patch
$ npm run changelog
git commit & push

CONTRIBUTING

  • ⇄ Pull requests and ★ Stars are always welcome.
  • For bugs and feature requests, please create an issue.
  • Pull requests must be accompanied by passing automated tests.

CHANGELOG

LICENSE

MIT: http://michaelhsu.mit-license.org

You can’t perform that action at this time.