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-12 19:27:32 +00:00
|
|
|
ctx.render(|c| {
|
|
|
|
builder::ElementBuilder::new(c, "div")
|
2021-02-12 08:07:35 +00:00
|
|
|
.child(VNode::Component(VComponent::new(
|
|
|
|
Bottom,
|
|
|
|
//
|
2021-03-12 19:27:32 +00:00
|
|
|
c.bump.alloc(()),
|
2021-02-12 08:07:35 +00:00
|
|
|
)))
|
|
|
|
.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>
|
|
|
|
})
|
|
|
|
};
|