I tried for getting the image path with Dropzone in this way {...form.getInputProps("tourImages")} but it gives undefined . Also, I tried getting an image input with useState hooks, image path is displaying but, it is not displaying inside of form. Please, see the below :
const getImage = (imageFile: any) => {
setImageUpload(imageFile[0].path);
};
const [imageUpload, setImageUpload] = useState( );
const form = useForm({
schema: joiResolver(schema),
initialValues: {
name: "",
sername: "",
email: "",
tourImages : "" ,
imageUpload,
},
});
<Dropzone
onDrop={(files) => {
getImage(files);
}}
onReject={(files) => console.log("rejected files", files)}
maxSize={3 * 1024 ** 2}
accept={IMAGE_MIME_TYPE}
{...form.getInputProps("tourImages")}
>
{(status) => dropzoneChildren(status, theme)}
</Dropzone>