react-dnd-dropzone
Dropzone with render props built with react-dnd.
This is a simple component for the use case of native files.
Installation
$ yarn add react-dnd-dropzone
Demo
Usage
; <Dropzone onDrop= console render= <div> Drop file here! <pre>JSON</pre> </div> />;
#56 by @smallfx).
With custom React-dnd context (PR;;;; const HTML5DropContext = <div>children</div>;const Dropzone = ; const App = <HTML5DropContext> <Dropzone onDrop= console render= <div> <pre>JSON</pre> </div> /> </HTML5DropContext>;
API
type DropzoneProps = void ReactElement<any> accepts?: Array<string>;
accepts
value: https://github.com/react-dnd/react-dnd/blob/master/packages/react-dnd-html5-backend/src/NativeTypes.js
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 changeloggit 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.