files state of FileUploaderDropContainer is remembered and not cleaned up!
See original GitHub issueWhat package(s) are you using?
-
carbon-components
-
carbon-components-react
Summary
I used the FileUploaderDropContainer from this component ProjectDropContainer: Sandbox: https://codesandbox.io/s/brave-voice-bdrx0
but I used it inside a Modal this time. After selecting a file, and closing the Modal then reopining it again the last selected file is still shown there! despite there is this line of code that should clean it:
const [files, setFiles] = useState([]);
Relevant information
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (6 by maintainers)
Top Results From Across the Web
FileUploader - Carbon Components React
Name Description Default
buttonKind Specify the type of the . ButtonKinds 'primary'
disabled Specify whether file input is disabled. bool false
labelDescription Specify the description text...
Read more >Remember and Repopulate File Input - Stack Overflow
What I want to know how to do is after a user selects a file I will remember their choice and redisplay the...
Read more >driveItem: createUploadSession - Microsoft Graph v1.0
This cleans up the temporary file holding the data previously uploaded. This should be used in scenarios where the upload is aborted, for ......
Read more >FileUploader - Carbon Components Svelte
The FileUploader wraps FileUploaderButton and lists out uploaded files. ... It sets the status to "complete" ; by default, the status is "loading"...
Read more >How to Troubleshoot Files Not Uploading - Kajabi Help Center
Log out and log back in. If you are experiencing issues or errors when attempting to upload your file to your site, begin...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks a lot. I used a hook for ComponentWillUnmout and cleared the files inside:
`function ProjectDropContainer(props) { const [files, setFiles] = useState([]);
Closing as a valid answer has been provided.