Skip to content

Commit 8843640

Browse files
committed
[REF]: Refactor dropzone children to catch empty array of ext files and display layer
1 parent 7b12940 commit 8843640

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/files-ui/components/dropzone/components/DropzoneChildren/DropzoneChildren.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,14 @@ const DropzoneChildren: React.FC<DropzoneChildrenProps> = (
1616
props: DropzoneChildrenProps
1717
) => {
1818
const { children, label, localization } = props;
19+
20+
const isEmptyArray = Array.isArray(children) && children.length===0;
21+
//console.log("isEmptyArray", isEmptyArray,children);
1922
const DropzoneLocalizer: LocalLabels =
2023
DropzoneLocalizerSelector(localization);
2124

2225
//children will be always consider as more important
23-
if (children) {
26+
if (children && !isEmptyArray) {
2427
return (
2528
<div className="files-ui-dropzone-children-container">{children}</div>
2629
);

0 commit comments

Comments
 (0)