Skip to content

Instantly share code, notes, and snippets.

@muhozi
Created April 1, 2019 20:10
Show Gist options
  • Save muhozi/c757af93147f2afe1e8814c0e9a2342a to your computer and use it in GitHub Desktop.
Save muhozi/c757af93147f2afe1e8814c0e9a2342a to your computer and use it in GitHub Desktop.
Select image method
/**
* 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