2021-02-10 17:48:02 +00:00
|
|
|
use dioxus_core::prelude::*;
|
|
|
|
|
|
|
|
fn main() {}
|
|
|
|
struct SomeContext {
|
|
|
|
items: Vec<String>,
|
|
|
|
}
|
|
|
|
|
2021-02-12 04:03:01 +00:00
|
|
|
#[allow(unused)]
|
2021-10-16 21:37:28 +00:00
|
|
|
static Example: FC<()> = |(cx, props)| {
|
2021-05-18 05:16:43 +00:00
|
|
|
todo!()
|
2021-06-01 22:33:15 +00:00
|
|
|
|
2021-06-26 01:15:33 +00:00
|
|
|
// let value = cx.use_context(|c: &SomeContext| c.items.last().unwrap());
|
2021-02-10 17:48:02 +00:00
|
|
|
|
2021-06-26 01:15:33 +00:00
|
|
|
// cx.render(LazyNodes::new(move |bump| {
|
2021-05-18 05:16:43 +00:00
|
|
|
// builder::ElementBuilder::new(bump, "button")
|
|
|
|
// .on("click", move |_| {
|
2021-06-26 01:15:33 +00:00
|
|
|
// println!("Value is {}", cx.name);
|
2021-05-18 05:16:43 +00:00
|
|
|
// println!("Value is {}", value.as_str());
|
|
|
|
// println!("Value is {}", *value);
|
|
|
|
// })
|
|
|
|
// .on("click", move |_| {
|
2021-06-26 01:15:33 +00:00
|
|
|
// println!("Value is {}", cx.name);
|
2021-05-18 05:16:43 +00:00
|
|
|
// })
|
|
|
|
// .finish()
|
|
|
|
// }))
|
2021-06-26 01:15:33 +00:00
|
|
|
// cx.render(html! {
|
2021-02-10 17:48:02 +00:00
|
|
|
// <div>
|
|
|
|
// <button onclick={move |_| println!("Value is {}", value)} />
|
|
|
|
// <button onclick={move |_| println!("Value is {}", value)} />
|
|
|
|
// <button onclick={move |_| println!("Value is {}", value)} />
|
|
|
|
// <div>
|
|
|
|
// <p> "Value is: {val}" </p>
|
|
|
|
// </div>
|
|
|
|
// </div>
|
|
|
|
// })
|
|
|
|
};
|