Created
April 1, 2019 20:10
-
-
Save muhozi/c757af93147f2afe1e8814c0e9a2342a to your computer and use it in GitHub Desktop.
Select image method
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Select image method | |
*/ | |
pickImage = () => { | |
ImagePicker.showImagePicker(options, response => { | |
if (response.didCancel) { | |
console.log('You cancelled image picker 😟'); | |
} else if (response.error) { | |
alert('And error occured: ', response.error); | |
} else { | |
const source = { uri: response.uri }; | |
this.setState({ | |
imgSource: source, | |
imageUri: response.uri | |
}); | |
} | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment