1.2.0 • Published 7 years ago

reactors-file-dialog v1.2.0

Weekly downloads
1
License
ISC
Repository
-
Last release
7 years ago

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:

import FileDialog from 'reactors-file-dialog';

<FileDialog
  color="green"
  onChange={(filePaths) => console.log('selected file(s)', filePaths)}
  />

Or create your own:

import {dialog} from 'reactors-file-dialog';

<View>
  <Text>{this.state.directory}</Text>

  <Button
    label="Change directory"
    onPress={() => this.setState({
      directory: await dialog.open(options),
    })}
    />
</View>

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