wip: more refactor

This commit is contained in:
Jonathan Kelley committed 2021-07-09 01:42:26 -04:00
1 parent c811a8982c
commit 58ab51a4e4
6 files changed
+261 -258

No files matched your search

+3 -18
View File
@@ -43,29 +43,14 @@ pub fn fc_to_builder<T: Properties>(_: FC<T>) -> T::Builder {
}
/// Create inline fragments
/// --
/// ------------------------
///
/// Fragments capture a series of children without rendering extra nodes.
///
/// Fragments are incredibly useful when necessary, but *do* add cost in the diffing phase.
/// Try to avoid nesting fragments if you can. Infinitely nested Fragments *will* cause diffing to crash.
use crate::prelude::*;
#[allow(non_upper_case_globals, non_snake_case)]
pub fn Fragment<'a>(cx: Context<'a, ()>) -> VNode<'a> {
let childs: &'a [VNode<'a>] = cx.children();
cx.render(LazyNodes::new({
move |f| {
//
f.fragment_from_iter(childs)
}
}))
cx.render(LazyNodes::new(move |f| f.fragment_from_iter(cx.children())))
}
// #[allow(non_upper_case_globals)]
// pub const Fragment: FC<()> = |cx| {
// use crate::prelude::*;
// let childs = cx.children();
// cx.render(LazyNodes::new(move |c| {
// c.fragment_from_iter(childs)
// // c.text(format_args!(""))
// // crate::nodebuilder::vfragment(c, None, cx.children())
// }))
// };