How to share mutable states in .with_file_drop_handler? #1069
Replies: 2 comments 1 reply
-
It seems that using the published dioxus packages may fail on implementing some examples. For example I used the latest published version of dioxus, dioxus-desktop and implemented the file_upload example. I found the app fails on uploading the files. Finally, I use the packages on the GitHub and succeed. |
Beta Was this translation helpful? Give feedback.
-
The published version just has a placeholder file handler trait. If you want just the examples that should work with the published version, you can look at the 0.3.2 tag on GitHub: https://github.com/DioxusLabs/dioxus/tree/2075ff3039feb1efb576d8f2ed5a2c4d0c554731 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I want to capture the dropped file by .with_file_drop_handler. Is there any way to share mutable states in the handler? It seems hooks cannot be used since an error information "borrowed data escapes outside of function". Also I hope there is a good way to upload the file and share mutable states to record the information of uploaded files. It seems that I can only use .with_file_drop_handler and meet the previous problem. The example in https://github.com/DioxusLabs/dioxus/blob/master/examples/file_upload.rs fails on my computer.
Beta Was this translation helpful? Give feedback.
All reactions