2
0
Fork 0
mirror of https://github.com/DioxusLabs/dioxus synced 2024-12-18 08:33:07 +00:00
dioxus/packages/core/examples/component_child.rs
2021-06-02 11:07:30 -04:00

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}
}
}
};