dioxus/packages/core/examples/step.rs

27 lines
547 B
Rust
Raw Normal View History

use dioxus_core::prelude::*;
2021-02-07 21:21:38 +00:00
2021-02-07 22:38:17 +00:00
fn main() -> Result<(), ()> {
2021-02-07 21:21:38 +00:00
let p1 = Props { name: "bob".into() };
2021-03-05 20:02:36 +00:00
let mut vdom = VirtualDom::new_with_props(Example, p1);
2021-03-08 02:28:20 +00:00
// vdom.update_props(|p: &mut Props| {});
2021-02-07 22:38:17 +00:00
Ok(())
2021-02-07 21:21:38 +00:00
}
2021-03-05 20:02:36 +00:00
#[derive(Debug, PartialEq)]
2021-02-07 21:21:38 +00:00
struct Props {
name: String,
}
2021-02-12 05:29:46 +00:00
2021-02-24 06:32:50 +00:00
static Example: FC<Props> = |ctx, _props| {
2021-03-01 02:21:17 +00:00
ctx.render(html! {
2021-02-07 21:21:38 +00:00
<div>
2021-02-12 05:29:46 +00:00
<h1> "hello world!" </h1>
<h1> "hello world!" </h1>
<h1> "hello world!" </h1>
<h1> "hello world!" </h1>
2021-02-07 21:21:38 +00:00
</div>
})
};