From 694e5f1cb3fa5121bbe53a747633ad6deb17b83e Mon Sep 17 00:00:00 2001 From: Greg Johnston Date: Tue, 23 Jan 2024 11:08:33 -0500 Subject: [PATCH] fix: cast to correct type on `Memo::try_with_untracked` --- leptos_reactive/src/memo.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/leptos_reactive/src/memo.rs b/leptos_reactive/src/memo.rs index b7b560d69..858305a85 100644 --- a/leptos_reactive/src/memo.rs +++ b/leptos_reactive/src/memo.rs @@ -357,7 +357,12 @@ impl SignalWithUntracked for Memo { #[inline] fn try_with_untracked(&self, f: impl FnOnce(&T) -> O) -> Option { with_runtime(|runtime| { - self.id.try_with_no_subscription(runtime, |v: &T| f(v)).ok() + self.id + .try_with_no_subscription(runtime, |v: &Option| { + v.as_ref().map(f) + }) + .ok() + .flatten() }) .ok() .flatten()