Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: improve types #887

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

fix: improve types #887

wants to merge 1 commit into from

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.

None yet

2 participants