mirror of
https://github.com/DioxusLabs/dioxus
synced 2024-11-24 05:03:06 +00:00
23 lines
479 B
Rust
23 lines
479 B
Rust
use dioxus_core::debug_renderer::DebugRenderer;
|
|
use dioxus_core::{component::Properties, prelude::*};
|
|
|
|
fn main() -> Result<(), ()> {
|
|
let p1 = SomeProps { name: "bob".into() };
|
|
|
|
let _vdom = DebugRenderer::new_with_props(Example, p1);
|
|
|
|
Ok(())
|
|
}
|
|
|
|
#[derive(Debug, PartialEq, Props)]
|
|
struct SomeProps {
|
|
name: String,
|
|
}
|
|
|
|
static Example: FC<SomeProps> = |ctx, _props| {
|
|
ctx.render(html! {
|
|
<div>
|
|
<h1> "hello world!" </h1>
|
|
</div>
|
|
})
|
|
};
|