Skip to content

Commit

Permalink
docs: Update Hooks and Components doc
Browse files Browse the repository at this point in the history
  • Loading branch information
yosipy committed Jul 28, 2024
1 parent 83f0ea4 commit 3f80837
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions docs/introduction/hooks-and-components.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ The fileRejections contains the reason for the rejection.
classifiedFiles is an array containing both acceptedFiles and fileRejections.
classifiedFiles is useful, for example, for adding your own custom validations.
ClassifiedFile type is defined as follows:
Simplified ClassifiedFile type is defined as follows:
```ts
export type RejectedCode = "more-than-one-file" | "accept-violations"
Expand All @@ -53,21 +53,20 @@ export type AcceptedClassifiedFile = {
errorCode: undefined
}

export type RejectedClassifiedFile<T extends string = string> = {
export type RejectedClassifiedFile = {
status: "rejected"
file: File
errorCode: T
errorCode: RejectedCode | string
}

export type ClassifiedFile<T extends string = string> =
| AcceptedClassifiedFile
| RejectedClassifiedFile<T>
export type ClassifiedFile = AcceptedClassifiedFile | RejectedClassifiedFile
```
Please [click here](https://github.com/yosipy/react-dropzone-vv/blob/main/lib/types.ts) for the latest type definitions.
ClassifiedFile is classified as “accepted” or “rejected” depending on its status.
ClassifiedFile is classified as "accepted" or "rejected" depending on its status.
How to split an array by status can be seen in the example.
Note that the RejectedCode may increase.
## ReactDropzoneVV
```tsx
Expand Down

0 comments on commit 3f80837

Please sign in to comment.