Reduce render allocations and redundant work in core components

This commit is contained in:
2026-11-09 14:35:15 +07:00
parent 73f7dc31d4
commit 122f9b12ae
19 changed files with 174 additions and 139 deletions
+6 -6
View File
@@ -95,8 +95,8 @@ impl RenderOnce for Field {
let title = div()
.debug_selector({
let name = format!("{id}-label");
move || name
let id = id.clone();
move || format!("{id}-label")
})
.text_size(metrics.text_size)
.child(self.label.clone());
@@ -105,16 +105,16 @@ impl RenderOnce for Field {
.items_center()
.gap_2()
.debug_selector({
let name = format!("{id}-control");
move || name
let id = id.clone();
move || format!("{id}-control")
})
.children(self.control);
let error = self.error.map(|error| {
div()
.debug_selector({
let name = format!("{id}-error");
move || name
let id = id.clone();
move || format!("{id}-error")
})
.text_size(metrics.caption_size)
.text_color(error_color)