Open kanwar002 opened 4 years ago
I dont think source
is a valid prop for this package. It only accepts the following props:
You should most likely set the uri
prop in the Image
component from result.uri
Change
<Image style={styles.image} source={{ uri: this.props.image }} />
To
<Image style={styles.image} uri={this.props.image } />
Failed prop type: Invalid prop
source
supplied toImage
I'm getting that error while uploading image. I used image picker to pick image and made it component but it's not picking up source below is my code of image picker FormImage.jsasync componentDidMount() { const { status } = await Permissions.askAsync(Permissions.CAMERA_ROLL); this.setState({ hasCameraPermission: status === "granted" }); }
_pickImage = async () => { let result = await ImagePicker.launchImageLibraryAsync({ mediaTypes: ImagePicker.MediaTypeOptions.Images, allowsEditing: true, aspect: [4, 3], });
};
render() { return (
} Addpost.js
class AddPost extends Component { render() { return ( <Formik initialValues={{ title: "", des: "", image: null }} onSubmit={(values, actions) => { this.props.addPost(values); console.log(values); }} validationSchema={validationSchema}
can anyone tell me what's going on?