wip: move everything over to a stack dst

This commit is contained in:
Jonathan Kelley committed 2021-10-29 17:12:30 -04:00
1 parent 12a9758c3c
commit 0e9d5fc530
36 files changed
+224 -185

No files matched your search

+1 -1
View File
@@ -9,7 +9,7 @@ fn main() {
pub static EXAMPLE: FC<()> = |(cx, _)| {
let list = (0..10).map(|_f| LazyNodes::new(move |_f| todo!()));
cx.render(LazyNodes::new(move |cx| {
Some(LazyNodes::new(move |cx| {
cx.raw_element(
"div",
None,
+4 -4
View File
@@ -20,10 +20,10 @@ struct ListItem {
age: u32,
}
fn app<'a>(cx: Context<'a>, props: &AppProps) -> DomTree<'a> {
fn app<'a>(cx: Context<'a>, props: &AppProps) -> Element<'a> {
// let (val, set_val) = use_state_classic(cx, || 0);
cx.render(LazyNodes::new(move |_nodecx| {
Some(LazyNodes::new(move |_nodecx| {
todo!()
// builder::ElementBuilder::new(_nodecx, "div")
// .iter_child({
@@ -56,8 +56,8 @@ struct ChildProps {
item_handler: Rc<dyn Fn(i32)>,
}
fn ChildItem<'a>(cx: Context<'a>, props: &'a ChildProps) -> DomTree<'a> {
cx.render(LazyNodes::new(move |__cx| todo!()))
fn ChildItem<'a>(cx: Context<'a>, props: &'a ChildProps) -> Element<'a> {
Some(LazyNodes::new(move |__cx| todo!()))
}
impl PartialEq for ChildProps {
+2 -2
View File
@@ -2,7 +2,7 @@ use dioxus_core::prelude::*;
fn main() {}
fn app<'a>(cx: Context<'a>, props: &()) -> DomTree<'a> {
fn app<'a>(cx: Context<'a>, props: &()) -> Element<'a> {
let vak = use_suspense(
cx,
|| async {},
@@ -26,7 +26,7 @@ fn app<'a>(cx: Context<'a>, props: &()) -> DomTree<'a> {
)
}));
cx.render(LazyNodes::new(move |f| {
Some(LazyNodes::new(move |f| {
f.raw_element(
"div",
None,
+6 -6
View File
@@ -15,7 +15,7 @@ fn main() {
assert!(g.edits.len() > 1);
}
fn App((cx, props): Component<()>) -> DomTree {
fn App((cx, props): Component<()>) -> Element {
let mut rng = SmallRng::from_entropy();
let rows = (0..10_000_usize).map(|f| {
let label = Label::new(&mut rng);
@@ -26,13 +26,13 @@ fn App((cx, props): Component<()>) -> DomTree {
}
}
});
cx.render(rsx! {
rsx! {
table {
tbody {
{rows}
}
}
})
}
}
#[derive(PartialEq, Props)]
@@ -41,11 +41,11 @@ struct RowProps {
label: Label,
}
fn Row((cx, props): Component<RowProps>) -> DomTree {
fn Row((cx, props): Component<RowProps>) -> Element {
let handler = move |evt: MouseEvent| {
let g = evt.button;
};
cx.render(rsx! {
rsx! {
tr {
td { class:"col-md-1", "{props.row_id}" }
td { class:"col-md-1", onclick: move |_| { /* run onselect */ }
@@ -58,7 +58,7 @@ fn Row((cx, props): Component<RowProps>) -> DomTree {
}
td { class: "col-md-6" }
}
})
}
}
#[derive(PartialEq)]
+5
View File
@@ -32,3 +32,8 @@ fn html_usage() {
}
};
}
static App: FC<()> = |(cx, props)| {
//
rsx!(div {})
};
+1 -1
View File
@@ -4,7 +4,7 @@ use dioxus_core::prelude::*;
#[async_std::main]
async fn main() {
static App: FC<()> = |(cx, props)| cx.render(LazyNodes::new(|f| f.text(format_args!("hello"))));
static App: FC<()> = |(cx, props)| Some(LazyNodes::new(|f| f.text(format_args!("hello"))));
let mut dom = VirtualDom::new(App);