import React from 'react' import { // StyleSheet, TouchableOpacity, Text, TextInput, View } from 'react-native' import Url from '@uppy/url' export default class UppyRNUrl extends React.Component { constructor () { super() this.state = { url: null } this.onPressImport = this.onPressImport.bind(this) } componentDidMount () { this.uppy = this.props.uppy this.uppy.use(Url, { id: 'uppyRN:Url', serverUrl: 'http://localhost:3020' }) this.plugin = this.uppy.getPlugin('uppyRN:Url') } componentWillUnmount () { this.uppy.removePlugin(this.plugin) } onPressImport () { this.plugin.addFile(this.state.url) .then(() => { console.log('success') }) .catch((err) => { console.log(err) }) } render () { return ( this.setState({ url: text })} placeholder="Enter URL to import a file" /> Import {this.state.text} ) } } // const styles = StyleSheet.create({ // container: { // justifyContent: 'center', // flex: 1, // paddingTop: 30 // }, // item: { // justifyContent: 'center', // alignItems: 'center', // height: 100 // } // })