https://github.com/co2-git/reactors-file-dialog
File dialog opener View for reactors
https://github.com/co2-git/reactors-file-dialog
Last synced: 11 months ago
JSON representation
File dialog opener View for reactors
- Host: GitHub
- URL: https://github.com/co2-git/reactors-file-dialog
- Owner: co2-git
- Created: 2017-01-12T06:14:08.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-01-30T16:10:08.000Z (over 9 years ago)
- Last Synced: 2025-03-27T11:44:44.734Z (about 1 year ago)
- Language: JavaScript
- Size: 164 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
reactors-file-dialog
===
File dialog support for reactors (right now only supports desktop, soon to support mobile)
# Usage
You can directly used our custom React component:
```javascript
import FileDialog from 'reactors-file-dialog';
console.log('selected file(s)', filePaths)}
/>
```
Or create your own:
```javascript
import {dialog} from 'reactors-file-dialog';
{this.state.directory}
this.setState({
directory: await dialog.open(options),
})}
/>
```
# Props
- `string color` Color of icon and text
- `(filePaths: string[]) => any onChange` Callback function on file selection change
- `(error: Error) => any onError` Callback function for eventual errors