Skip to content

Commit

Permalink
fix Accept type
Browse files Browse the repository at this point in the history
  • Loading branch information
Ludea committed Feb 5, 2025
1 parent 510b09c commit 7d8feb4
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/components/DropzoneAreaBase.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import React, {
HTMLProps,
PureComponent,
} from "react";
import Dropzone, { DropEvent, DropzoneProps } from "react-dropzone";
import Dropzone, { Accept, DropEvent, DropzoneProps } from "react-dropzone";

import { convertBytesToMbsOrKbs, isImage, readFile } from "../helpers";
import { AlertType, FileObject } from "../types";
Expand Down Expand Up @@ -88,7 +88,7 @@ export interface DropzoneAreaBaseProps {
*
* @see See [here](https://react-dropzone.js.org/#section-accepting-specific-file-types) for more details.
*/
acceptedFiles?: string[];
acceptedFiles?: Accept;
/** Maximum number of files that can be loaded into the dropzone. */
filesLimit?: number;
/** Currently loaded files. */
Expand Down Expand Up @@ -596,7 +596,6 @@ class DropzoneAreaBase extends PureComponent<
} = this.props;
const { openSnackBar, snackbarMessage, snackbarVariant } = this.state;

const acceptFiles = acceptedFiles?.join(",");
const isMultiple = filesLimit > 1;
const previewsVisible = showPreviews && fileObjects.length > 0;
const previewsInDropzoneVisible =
Expand All @@ -606,7 +605,7 @@ class DropzoneAreaBase extends PureComponent<
<Fragment>
<Dropzone
{...dropzoneProps}
accept={acceptFiles}
accept={acceptedFiles}
onDropAccepted={this.handleDropAccepted}
onDropRejected={this.handleDropRejected}
maxSize={maxFileSize}
Expand Down

0 comments on commit 7d8feb4

Please sign in to comment.