wip: implement lazy nodes properly
This commit is contained in:
1 parent
7b97e009ec
commit
3e07214272
7 files changed
+47
-67
No files matched your search
@@ -17,7 +17,7 @@ pub static EXAMPLE: FC<()> = |(cx, _)| {
|
||||
});
|
||||
// let list = (0..10).map(|_f| Some(Box::new(move |_f| todo!())));
|
||||
|
||||
cx.render(Some(Box::new(move |cx| {
|
||||
cx.render(Some(LazyNodes::new(move |cx| {
|
||||
cx.raw_element(
|
||||
"div",
|
||||
None,
|
||||
|
||||
@@ -4,7 +4,7 @@ use std::marker::PhantomData;
|
||||
|
||||
use dioxus::component::Scope;
|
||||
use dioxus::events::on::MouseEvent;
|
||||
use dioxus::nodes::{annotate_lazy, IntoVNode, VComponent, VFragment, VText};
|
||||
use dioxus::nodes::{IntoVNode, VComponent, VFragment, VText};
|
||||
use dioxus_core as dioxus;
|
||||
use dioxus_core::prelude::*;
|
||||
use dioxus_core_macro::*;
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
use std::time::Duration;
|
||||
|
||||
use dioxus_core::prelude::*;
|
||||
use dioxus_core::{lazynodes::LazyNodes, prelude::*};
|
||||
|
||||
// #[async_std::main]
|
||||
fn main() {
|
||||
static App: FC<()> =
|
||||
|(cx, props)| cx.render(Some(Box::new(move |f| f.text(format_args!("hello")))));
|
||||
|(cx, props)| cx.render(Some(LazyNodes::new(move |f| f.text(format_args!("hello")))));
|
||||
|
||||
let mut dom = VirtualDom::new(App);
|
||||
|
||||
|
||||
Reference in new issue
Block a user