dioxus/packages/core/examples/nested.rs
Jonathan Kelley ec801eab16 wip: foregin eq from comparapable comp type.
This commit adds the framework for "comparable components". This allows
complete sealing of bump-allocated properties types, and a comparison method
that performs a "safe" cast without transmute. This lets us completely erase types
but still be able to perform partialeq over render frames
2021-03-12 13:03:37 -05:00

33 lines
674 B
Rust

#![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());
ctx.render(|bump| {
builder::ElementBuilder::new(bump, "div")
.child(VNode::Component(VComponent::new(
Bottom,
//
&mut (),
)))
.finish()
})
};
static Bottom: FC<()> = |ctx, props| {
ctx.render(html! {
<div>
<h1> "bruh 1" </h1>
<h1> "bruh 2" </h1>
</div>
})
};