Skip to content

Commit 8a234b0

Browse files
nfantoneokonet
authored andcommitted
docs: fix styling example always showing same message
1 parent d693505 commit 8a234b0

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

examples/Styling/Readme.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,21 @@ By default, the Dropzone component picks up some default styling to get you star
44

55
By providing a function that returns the component's children you can not only style Dropzone appropriately but also render appropriate content.
66

7-
```
7+
```jsx
88
<Dropzone
99
accept="image/png"
1010
>
11-
{({ isDragActive, isDragReject, acceptedFiles, rejectedFiles }) => {
12-
if (isDragActive) {
11+
{({ isDragAccept, isDragReject, acceptedFiles, rejectedFiles }) => {
12+
if (acceptedFiles.length || rejectedFiles.length) {
13+
return `Accepted ${acceptedFiles.length}, rejected ${rejectedFiles.length} files`;
14+
}
15+
if (isDragAccept) {
1316
return "This file is authorized";
1417
}
1518
if (isDragReject) {
1619
return "This file is not authorized";
1720
}
18-
return acceptedFiles.length || rejectedFiles.length
19-
? `Accepted ${acceptedFiles.length}, rejected ${rejectedFiles.length} files`
20-
: "Try dropping some files.";
21+
return "Try dropping some files.";
2122
}}
2223
</Dropzone>
2324
```

0 commit comments

Comments
 (0)