From a7f873ad2956354da2f43fc91b446270a3a71f41 Mon Sep 17 00:00:00 2001 From: luoxiao Date: Sat, 30 Mar 2024 01:35:42 +0800 Subject: [PATCH] fix: nightly mode Message error --- thaw/src/message/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/thaw/src/message/mod.rs b/thaw/src/message/mod.rs index f8a60fa..58ad70c 100644 --- a/thaw/src/message/mod.rs +++ b/thaw/src/message/mod.rs @@ -62,7 +62,7 @@ fn Message(message: MessageType, #[prop(into)] on_close: Callback) -> }); let style = theme.with_untracked(|theme| format!("color: {};", variant.theme_color(theme))); - let on_before_leave = move |_| { + let on_before_leave = Callback::new(move |_| { let Some(node_el) = message_ref.get() else { return; }; @@ -71,7 +71,7 @@ fn Message(message: MessageType, #[prop(into)] on_close: Callback) -> let el = any_el.deref(); let style = el.style(); let _ = style.set_property("max-height", &format!("{}px", el.offset_height())); - }; + }); let on_after_leave = Callback::new(move |_| { queue_microtask(move || on_close.call(id)); });