https://github.com/erykpiast/bs-react-dropzone
ReasonML bindings for react-dropzone library
https://github.com/erykpiast/bs-react-dropzone
bindings drag-and-drop dropzone reason-react reasonml
Last synced: about 1 month ago
JSON representation
ReasonML bindings for react-dropzone library
- Host: GitHub
- URL: https://github.com/erykpiast/bs-react-dropzone
- Owner: erykpiast
- License: mit
- Created: 2019-03-10T11:38:29.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2023-02-28T10:43:32.000Z (about 3 years ago)
- Last Synced: 2025-09-30T10:55:10.658Z (6 months ago)
- Topics: bindings, drag-and-drop, dropzone, reason-react, reasonml
- Language: Reason
- Size: 1.15 MB
- Stars: 5
- Watchers: 1
- Forks: 1
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# bs-react-dropzone
[](https://travis-ci.com/erykpiast/bs-react-dropzone)
[](https://david-dm.org/erykpiast/bs-react-dropzone)
[](https://david-dm.org/erykpiast/bs-react-dropzone?type=dev)
[](https://david-dm.org/erykpiast/bs-react-dropzone?type=peer)
[](https://greenkeeper.io/)
ReasonML bindings for [react-dropzone](https://github.com/react-dropzone/react-dropzone) library.
## Installation
```
npm i --save bs-react-dropzone react-dropzone
```
Then add `bs-react-dropzone` as a dependency to `bsconfig.json`.
## Usage
```reasonml
[@react.component]
let make = () => {
Js.log(("these files were dropped", acceptedFiles))
}>
{({getInputProps, getRootProps}) => {
let inputProps = getInputProps();
let rootProps = getRootProps();
{"Drop files here" |> React.string}
;
}}
;
};
```
### JSX 2
The package provides fallback for projects using older version of JSX syntax.
```reasonml
let component = ReasonReact.statelessComponent("Demo");
let make = () => {
...component,
render: (_self) => {
Js.log(("these files were dropped", acceptedFiles))
}>
...{({getInputProps, getRootProps}) => {
let inputProps = getInputProps();
let rootProps = getRootProps();
{"Drop files here" |> React.string}
;
}}
;
}
};
```
### Hooks
Hooks are not supported right now. There is [an issue open for that](https://github.com/erykpiast/bs-react-dropzone/issues/3). PRs are welcome!