v7.0.0
7.0.0 (2018-10-26)
Code Refactoring
BREAKING CHANGES
- File{preview} has been removed to avoid possible memory leaks
If you wish to create previews, you can easily achieve this in the onDrop()
callback:
class MyZone extends React.Component {
onDrop = files => {
this.setState({
files: files.map(file => ({
...file,
preview: URL.createObjectURL(file)
}))
});
}
cleanup = () => {
// Revoke data uris when done using the previews
const {files} = this.state;
for (const file of files) {
URL.revokeObjectURL(file.preview);
}
}
render() {
return (
<Dropzone onDrop={this.onDrop} />
);
}
}