mirror of
https://github.com/DioxusLabs/dioxus
synced 2024-12-24 03:23:11 +00:00
29 lines
594 B
Rust
29 lines
594 B
Rust
|
use anyhow::{Context, Result};
|
||
|
use dioxus::{
|
||
|
arena::SharedResources,
|
||
|
diff::{CreateMeta, DiffMachine},
|
||
|
prelude::*,
|
||
|
DomEdit,
|
||
|
};
|
||
|
use dioxus_core as dioxus;
|
||
|
use dioxus_html as dioxus_elements;
|
||
|
|
||
|
#[test]
|
||
|
fn sample_refs() {
|
||
|
static App: FC<()> = |cx| {
|
||
|
let div_ref = use_node_ref::<MyRef, _>(cx);
|
||
|
|
||
|
cx.render(rsx! {
|
||
|
div {
|
||
|
style: { color: "red" }
|
||
|
node_ref: div_ref
|
||
|
onmouseover: move |_| {
|
||
|
div_ref.borrow_mut().focus();
|
||
|
}
|
||
|
}
|
||
|
})
|
||
|
};
|
||
|
}
|
||
|
|
||
|
struct MyRef {}
|