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| {
|
2021-03-03 16:13:46 +00:00
|
|
|
builder::ElementBuilder::new(bump, "div")
|
2021-02-12 08:07:35 +00:00
|
|
|
.child(VNode::Component(VComponent::new(
|
|
|
|
Bottom,
|
|
|
|
//
|
2021-03-12 18:03:37 +00:00
|
|
|
&mut (),
|
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>
|
|
|
|
})
|
|
|
|
};
|