mirror of
https://github.com/DioxusLabs/dioxus
synced 2024-12-24 19:43:10 +00:00
36 lines
1.1 KiB
Rust
36 lines
1.1 KiB
Rust
use dioxus_core::prelude::*;
|
|
|
|
fn main() {}
|
|
struct SomeContext {
|
|
items: Vec<String>,
|
|
}
|
|
|
|
#[allow(unused)]
|
|
static Example: FC<()> = |cpt| {
|
|
todo!()
|
|
|
|
// let value = cx.use_context(|c: &SomeContext| c.items.last().unwrap());
|
|
|
|
// cx.render(LazyNodes::new(move |bump| {
|
|
// builder::ElementBuilder::new(bump, "button")
|
|
// .on("click", move |_| {
|
|
// println!("Value is {}", cx.name);
|
|
// println!("Value is {}", value.as_str());
|
|
// println!("Value is {}", *value);
|
|
// })
|
|
// .on("click", move |_| {
|
|
// println!("Value is {}", cx.name);
|
|
// })
|
|
// .finish()
|
|
// }))
|
|
// cx.render(html! {
|
|
// <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>
|
|
// })
|
|
};
|