2021-09-13 04:59:08 +00:00
|
|
|
use std::{cell::RefCell, rc::Rc};
|
|
|
|
|
2021-08-09 21:09:33 +00:00
|
|
|
use anyhow::{Context, Result};
|
2021-09-02 03:57:34 +00:00
|
|
|
use dioxus::prelude::*;
|
2021-08-09 21:09:33 +00:00
|
|
|
use dioxus_core as dioxus;
|
|
|
|
use dioxus_html as dioxus_elements;
|
|
|
|
|
2021-09-13 04:59:08 +00:00
|
|
|
type Shared<T> = Rc<RefCell<T>>;
|
|
|
|
|
2021-08-09 21:09:33 +00:00
|
|
|
#[test]
|
|
|
|
fn sample_refs() {
|
2021-09-13 04:59:08 +00:00
|
|
|
|
2021-08-15 14:13:03 +00:00
|
|
|
// static App: FC<()> = |cx| {
|
|
|
|
// let div_ref = use_node_ref::<MyRef, _>(cx);
|
2021-08-09 21:09:33 +00:00
|
|
|
|
2021-08-15 14:13:03 +00:00
|
|
|
// cx.render(rsx! {
|
|
|
|
// div {
|
|
|
|
// style: { color: "red" },
|
|
|
|
// node_ref: div_ref,
|
|
|
|
// onmouseover: move |_| {
|
|
|
|
// div_ref.borrow_mut().focus();
|
|
|
|
// },
|
|
|
|
// },
|
|
|
|
// })
|
|
|
|
// };
|
2021-08-09 21:09:33 +00:00
|
|
|
}
|