Checkpoint

This commit is contained in:
Antonio Scandurra
2023-10-17 11:08:48 +02:00
parent ac5b32c491
commit fb1e7eef6b
14 changed files with 223 additions and 111 deletions
+2 -2
View File
@@ -47,7 +47,7 @@ where
type ViewState = S;
type ElementState = ();
fn element_id(&self) -> Option<ElementId> {
fn id(&self) -> Option<ElementId> {
self.id.clone()
}
@@ -188,7 +188,7 @@ where
cx: &mut ViewContext<S>,
f: impl FnOnce(&mut Self, &mut ViewContext<S>) -> R,
) -> R {
if let Some(element_id) = self.element_id() {
if let Some(element_id) = self.id() {
cx.with_element_id(element_id, |cx| f(self, cx))
} else {
f(self, cx)