Skip to content

fix: improve types#887

Open
songhn233 wants to merge 1 commit intopqina:masterfrom
songhn233:patch-1
Open

fix: improve types#887
songhn233 wants to merge 1 commit intopqina:masterfrom
songhn233:patch-1

Conversation

@songhn233
Copy link

While the files property can also be populated with new files, it is advised to add new files using only the addFile and addFiles methods.

When using React or other cases, such as a quickstart example:

const [files, setFiles] = useState<FilePondFile[]>([]);

<FilePond
  files={files}
  onupdatefiles={(files) => setFiles(files)}
/>

This will throw a type error because:

files?: Array<FilePondInitialFile | ActualFileObject | Blob | string>;
onupdatefiles?: ((files: FilePondFile[]) => void)

@CarelessCourage
Copy link

This is an issue we are dealing with too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants