How to get rct-image-store image url to upload image via api

How to get image url from rct-image store? I cropped the image using ImageEditingManager and it returned me rct-image-store: // 0. Now I need to upload this image to the server. How to get the image url so that it can be downloaded?

Here is the code I used

ImageEditingManager.cropImage( photoURI, transformData, (croppedImageURI) => { console.log('crop success', croppedImageURI); }, (cropError) => console.log('cropMyError', cropError) ); }, (error) => undefined, ); 

croppedImageURI is registered as

RCT-image-store: // 0

How to get the url of this image so that I can upload it to api server?

+7
react-native
source share
1 answer

 var testDemo = React.createClass({ getInitialState() { return { imageURISource: { uri: 'http://facebook.imtqy.com/react/img/logo_og.png' } } }, render: function() { return ( <View style={styles.container}> <Image style={{height:250,width:300, borderColor: '#f099f0',borderRadius:3}} source= {this.state.imageURISource} /> ImageEditingManager.cropImage( photoURI, transformData, (croppedImageURI) => { console.log('crop success', croppedImageURI); //get croppedImageURI and set, it will update Image this.setState({imageURISource: {uri:croppedImageURI}}) }, (cropError) => console.log('cropMyError', cropError) ); </View> ); }, }); 
-3
source share

All Articles