-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Labels
Description
Clear and concise description of the problem
Use case
watchEffect(() => {
console.log({
accept: props.allowedFileTypes?.join(','),
directory: props.directory,
multiple: !props.singleFile,})
})
const { open: openFileBrowser, onChange, reset } = useFileDialog({
accept: props.allowedFileTypes?.join(','),
directory: props.directory,
multiple: !props.singleFile,
})
When props.directory changes, and I can see it change via watchEffect, useFileDialog doesn't update.
So when I try to add it using a ref or computed, I get Type 'ComputedRef<boolean>' is not assignable to type 'boolean | undefined'.ts-plugin(2322)
Suggested solution
I'll make a PR in about by the end of the week that makes makes useFileDialog completely reactive.
Alternative
The alternative at the moment is to have separate component instances to reset the state. It works for now, but that means I lose the state for a bunch of other things too.
Additional context
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that request the same feature to avoid creating a duplicate.