//Put it in a function (worked for me)
function DragDrop() {
const [file, setFile] = useState(null);
const handleChange = file => {
setFile(file);
};
return (
<FileUploader
handleChange={handleChange}
name="file"
/>
);
}
//And call it e.g.
return (
...
<DragDrop/>
...
)