I have a code that picks an image from the gallery, i want after selecting an image to navigate to another component to display the selected image there, it's working fine until i navigate to the other component it's not displaying the selected image actually i don't know how should i display it there, help please, here is the code:
state = {
image: null,
};
_pickImage = async () => {
const { navigate } = this.props.navigation;
let result = await ImagePicker.launchImageLibraryAsync({
allowsEditing: false,
aspect: [4, 4],
});
navigate('ConfirmImage');
if (!result.cancelled) {
this.setState({ image: result.uri });
}
To upload the image
let { image } = this.state;
<TouchableOpacity onPress={this._pickImage}><Text>Upload</Text></TouchableOpacity>