validateFile(file) {
    const {
      supportedFileTypes,
      supportedFileTypesMessage,
      maxFileSize,
      maxFileSizeMessage,
    } = this.props

    if (utils.isTooBig(file, maxFileSize)) {
      this.setState({errorMessage: maxFileSizeMessage})
      return false
    }

    if (utils.isUnsupportedFileType(file, supportedFileTypes)) {
      this.setState({errorMessage: supportedFileTypesMessage})
      return false
    }

    return true
  }
// check file size and type and set the error message accordingly
check file size and type and set the error message accordingly
check file size and type and set the error message accordingly
validateFile(file) {
    const {
      supportedFileTypes,
      supportedFileTypesMessage,
      maxFileSize,
      maxFileSizeMessage,
    } = this.props
    if (utils.isTooBig(file, maxFileSize)) {
      this.setState({errorMessage: maxFileSizeMessage})
      return false
    }
    if (utils.isUnsupportedFileType(file, supportedFileTypes)) {
      this.setState({errorMessage: supportedFileTypesMessage})
      return false
    }
    return true
  }
validateFile ( file ) { const { supportedFileTypes , supportedFileTypesMessage , maxFileSize , maxFileSizeMessage , } = this . props if ( utils . isTooBig ( file , maxFileSize ) ) { this . setState ( { errorMessage : maxFileSizeMessage } ) return false } if ( utils . isUnsupportedFileType ( file , supportedFileTypes ) ) { this . setState ( { errorMessage : supportedFileTypesMessage } ) return false } return true }
check file size and type and set the error message accordingly
check file size and type and set the error message accordingly