Failed prop type: Invalid prop source supplied to Image 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.js
`class FormImage extends Component {
state = {
hasCameraPermission: null,
};
async 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],
});
if (!result.cancelled) {
this.setState({ image: result.uri });
this.props.formikProps.setFieldValue("image", result.uri);
}
Failed prop type: Invalid prop source supplied to Image 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.js `class FormImage extends Component { state = { hasCameraPermission: null, };
async 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
const validationSchema = Yup.object({ title: Yup.string().required().min(5).max(15).label("Title"), des: Yup.string().required().min(15).max(200).label("Description"), image: Yup.mixed(), });class AddPost extends Component { render() { return ( <Formik initialValues={{ title: "", des: "", image: null }} onSubmit={(values, actions) => { this.props.addPost(values); console.log(values); }} validationSchema={validationSchema}