i want to create a dropzone in my react project but for some reason even the code from their site gives an error
import { ImageType } from "@/app/admin/add-products/AddProductForm";
import { useCallback } from "react";
import {useDropzone} from 'react-dropzone'
interface SelectImageProps {
item?: ImageType;
handleFIleChange: (value: File) => void
}
const SelectImage: React.FC<SelectImageProps> = ({
item,
handleFIleChange,
}) => {
const onDrop = useCallback((acceptedFiles:File[]) => {
}, []);
const {getRootProps, getInputProps, isDragActive} = useDropzone({onDrop})
return <div></div>;
};
export default SelectImage;
i get this erorr Argument of type ‘{ onDrop: (acceptedFiles: File[]) => void; }’ is not assignable to parameter of type ‘DropzoneOptions’.
Type ‘{ onDrop: (acceptedFiles: File[]) => void; }’ is missing the following properties from type ‘Pick<React.HTMLProps, PropTypes>’: multiple, onDragEnter, onDragOver, onDragLeave
i have copied the code from their website, still same error multiple times, and install dropzone just as much
i was trying to create a dropzone but it guess that’s but its not working
Viteazu Mihai is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.