Function reconcile_existing_component

Source
pub fn reconcile_existing_component<A: 'static>(
    tree: &mut ElementTree<A>,
    runtime: &RuntimeHandle<A>,
    element_id: ElementId,
) -> bool
Expand description

Rebuilds and reconciles one retained component in place.

Returns false without mutation for a missing ID or non-component kind. Otherwise it invalidates layout, records one build, invokes the component, reconciles its single built child, and returns true. Panics propagate after partial mutation and are not rolled back.

ยงExamples

use ailloli_ui_runtime::app::RuntimeHandle;
use ailloli_ui_runtime::element::{ElementKind, ElementTree};
use ailloli_ui_runtime::element::reconcile::reconcile_existing_component;
let runtime = RuntimeHandle::<()>::new();
let mut tree = ElementTree::new();
let id = tree.create_element(ElementKind::Empty, None, None);
assert!(!reconcile_existing_component(&mut tree, &runtime, id));