Skip to content

Commit ea102b2

Browse files
committed
[FIX]: Fix infinite buble when value is not given. Solution was to use the default value
1 parent ab6b75c commit ea102b2

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ const Dropzone: React.FC<DropzoneProps> = (props: DropzoneProps) => {
9191
...rest
9292
} = mergeProps(props, defaultDrozoneProps);
9393
console.log("Dropzone props", children);
94+
console.log("Dropzone value", value);
9495
const {
9596
url,
9697
method,

src/files-ui/components/dropzone/components/dropzone/DropzoneProps.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -287,10 +287,10 @@ export type DropzoneAdvancedConfig = {
287287

288288

289289
type DefDivProps = React.HTMLProps<HTMLDivElement>;
290-
type DivPropsOmitInputButtonFullProps = Omit<DefDivProps, keyof DropzoneFullProps>;
290+
type DivPropsOmitDropzoneFullProps = Omit<DefDivProps, keyof DropzoneFullProps>;
291291

292292
export declare type DropzoneProps =
293-
DivPropsOmitInputButtonFullProps &
293+
DivPropsOmitDropzoneFullProps &
294294
{
295295
[D in keyof DropzoneFullProps]: DropzoneFullProps[D]
296296
}
@@ -305,5 +305,6 @@ export const defaultDrozoneProps: DropzoneProps =
305305
uploadConfig: {},
306306
actionButtons: {},
307307
header: true,
308-
footer: true
308+
footer: true,
309+
value: [],
309310
}

src/files-ui/components/file-input-button/InputButtonProps.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,10 @@ export declare type FileInputButtonProps =
142142
export const defaultFileInputButtonProps: FileInputButtonProps =
143143
{
144144
textDecoration: "uppercase",
145-
label:"browse...",
145+
label: "browse...",
146146
behaviour: "add",
147147
disabled: false,
148148
uploadConfig: {},
149149
actionButtons: {},
150+
value: [],
150151
}

src/files-ui/hooks/useDropzoneFileUpdater.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ const useDropzoneFileListUpdater = (
2525
localization?: Localization,
2626
validateFilesFlag?: boolean
2727
): [ExtFile[], number, React.Dispatch<React.SetStateAction<ExtFile[]>>] => {
28+
29+
console.log("FileListUpdater",dropzoneId, value, isUploading, maxFileSize, accept, maxFiles, validateFilesFlag);
30+
2831
//state for managing the files locally
2932
const [localFiles, setLocalFiles] = React.useState<ExtFile[]>([]);
3033
// the current number of valid files

0 commit comments

Comments
 (0)