dioxus/examples/filedragdrop.rs
Jon Kelley 540e785d8b
Less clumsy configuration for desktop and mobile (#553)
* chore: dont use prebuilt builder pattern for configuring desktop

* chore: use regular config pattern for web

* Chore: update docs too

* chore: clean up some warnings
2022-09-13 16:22:27 -07:00

19 lines
378 B
Rust

use dioxus::prelude::*;
use dioxus_desktop::Config;
fn main() {
let cfg = Config::new().with_file_drop_handler(|_w, e| {
println!("{:?}", e);
true
});
dioxus_desktop::launch_with_props(app, (), cfg);
}
fn app(cx: Scope) -> Element {
cx.render(rsx!(
div {
h1 { "drag a file here and check your console" }
}
))
}