dioxus/packages/core/examples/nested.rs

34 lines
674 B
Rust
Raw Normal View History

2021-02-12 05:29:46 +00:00
#![allow(unused)]
//! Example of components in
use std::borrow::Borrow;
use dioxus_core::prelude::*;
fn main() {}
static Header: FC<()> = |ctx, props| {
let inner = use_ref(&ctx, || 0);
let handler1 = move || println!("Value is {}", inner.current());
2021-03-01 02:21:17 +00:00
ctx.render(|bump| {
builder::ElementBuilder::new(bump, "div")
.child(VNode::Component(VComponent::new(
Bottom,
//
&mut (),
)))
.finish()
2021-02-12 05:29:46 +00:00
})
};
static Bottom: FC<()> = |ctx, props| {
2021-03-01 02:21:17 +00:00
ctx.render(html! {
2021-02-12 05:29:46 +00:00
<div>
<h1> "bruh 1" </h1>
<h1> "bruh 2" </h1>
</div>
})
};