An open API service indexing awesome lists of open source software.

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

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