2022-10-20 16:56:09 +00:00
|
|
|
use crate::{ElementId, VNode};
|
|
|
|
use std::cell::Cell;
|
|
|
|
|
|
|
|
/// A list of VNodes with no single root.
|
|
|
|
pub struct VFragment<'src> {
|
|
|
|
/// The key of the fragment to be used during keyed diffing.
|
|
|
|
pub key: Option<&'src str>,
|
|
|
|
|
2022-10-27 01:04:47 +00:00
|
|
|
/// The [`ElementId`] of the placeholder if it exists
|
2022-10-20 16:56:09 +00:00
|
|
|
pub placeholder: Cell<Option<ElementId>>,
|
|
|
|
|
|
|
|
/// Fragments can never have zero children. Enforced by NodeFactory.
|
|
|
|
///
|
|
|
|
/// You *can* make a fragment with no children, but it's not a valid fragment and your VDom will panic.
|
|
|
|
pub children: &'src [VNode<'src>],
|
|
|
|
}
|