mirror of
https://github.com/DioxusLabs/dioxus
synced 2024-12-23 02:53:12 +00:00
29 lines
483 B
Rust
29 lines
483 B
Rust
use std::{ops::Deref, rc::Rc};
|
|
|
|
use dioxus::virtual_dom::Scope;
|
|
use dioxus_core::prelude::*;
|
|
|
|
type RcStr = Rc<str>;
|
|
|
|
fn main() {
|
|
let r: RcStr = "asdasd".into();
|
|
let r: RcStr = String::from("asdasd").into();
|
|
|
|
let g = rsx! {
|
|
div {
|
|
Example {}
|
|
}
|
|
};
|
|
}
|
|
|
|
static Example: FC<()> = |ctx| {
|
|
let nodes = ctx.children();
|
|
|
|
//
|
|
rsx! { in ctx,
|
|
div {
|
|
h1 {"these are children nodes: "}
|
|
{nodes}
|
|
}
|
|
}
|
|
};
|