Resize observer hooks for Dioxus 🧬.
use dioxus::prelude::*;
use dioxus_resize_observer::use_size;
use dioxus_use_mounted::use_mounted;
fn app() -> Element {
let mounted = use_mounted();
let (width, height) = use_size(mounted);
rsx!(div {
onmounted: move |event| mounted.onmounted(event),
"Size: {width} x {height}"
})
}
- Web renderer (WASM)
- 0.1.0 - Dioxus v0.4
- 0.2.0 - Dioxus v0.5
- 0.3.0 - Dioxus v0.6
MIT