Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
require => {
const Dropzone = require('react-dropzone').default
this.setState({Dropzone})
},
'react-dropzone'
import autobind from "autobind-decorator"
import * as React from "react"
import * as upload from "superagent"
import { InlineComponentProps } from "../CruxComponent"
let Dropzone = require("react-dropzone")
if ("default" in Dropzone) {
Dropzone = Dropzone.default
}
@autobind
export class ImageUploadComponent extends React.Component {
constructor(props: any) {
super(props)
this.state = {
inProgress: false
}
}
onDrop(files: any, width: string, height: string, contentType: string) {
const formData = new FormData()
formData.append("images", files[0])
if (width) {
formData.append("width", width)