I have here an image uploader. My problem is that I wanted to let the alert appear first after clicking if you haven't selected from the autocomplete.
Currently the alert appears after choosing an image.
Codesandbox CLICK HERE
const handleDrop = (e) => {
e.nativeEvent.preventDefault();
if (!value) {
setOpen(true);
} else {
if (!e) return;
const files = e.nativeEvent.dataTransfer.files;
onUploadImage(files);
}
};
const browseFiles = (e) => {
if (!value) {
setOpen(true);
} else {
if (!e) return;
const files = e.currentTarget.files;
onUploadImage(files);
}
e.target.value = null;
};