how to pass onDrop callback to ImageInput

Viewed 648

I am trying to pass a callback so I can use ImageInput to save the files/images before the form is submitted..I am curious how this can be done.. onDrop, onChange etc.. don't do anything. Thanks!

const callback = () => { console.log("callback"); }
[..]
<ImageInput source="pictures" accept="image/*" onDrop={callback}>
  <ImageField source="src" title="title" />
</ImageInput>
1 Answers

You have to include the onDrop event inside options properties.

const callback = () => { console.log("callback"); }
[..]
<ImageInput source="pictures" accept="image/*" options={{onDrop:callback}}>
  <ImageField source="src" title="title" />
</ImageInput>
Related