wip: groundwork for noderefs

This commit is contained in:
Jonathan Kelley committed 2021-08-09 17:09:33 -04:00
1 parent a44e9fcffa
commit c1afeba1ef
21 files changed
+184 -103

No files matched your search

+28
View File
@@ -0,0 +1,28 @@
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 {}