From 9479d2376de39c53aeb0a63fa3f475b79e3ced93 Mon Sep 17 00:00:00 2001 From: Evan Almloff Date: Wed, 24 Jul 2024 11:33:28 -0700 Subject: [PATCH] fix RuntimeError message formatting --- packages/core/src/runtime.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/core/src/runtime.rs b/packages/core/src/runtime.rs index 73490ef25..f95b96f8f 100644 --- a/packages/core/src/runtime.rs +++ b/packages/core/src/runtime.rs @@ -334,19 +334,19 @@ use dioxus::prelude::*; static COUNT: GlobalSignal = Signal::global(|| 0); #[component] -fn MyComponent() -> Element { - use_effect(|| { +fn MyComponent() -> Element {{ + use_effect(|| {{ // Grab the runtime from the MyComponent scope let runtime = Runtime::current().expect(\"Components run in the Dioxus runtime\"); // Move the runtime into the web-sys closure scope - let web_sys_closure = Closure::new(|| { + let web_sys_closure = Closure::new(|| {{ // Then create a guard to provide the runtime to the closure let _guard = RuntimeGuard::new(runtime); // and run whatever code needs the runtime - tracing::info!(\"The count is: {COUNT}\"); - }); - }) -} + tracing::info!(\"The count is: {{COUNT}}\"); + }}); + }}) +}} ```" ) }