react-input-files
v1.2.0
Published
Reusable React input file component.
Downloads
9,108
Readme
react-input-files
Reusable React input file component.
Installation
$ yarn add react-input-files
Demo
- https://react-input-files.netlify.com/
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.