瀏覽代碼

fix RuntimeError message formatting

Evan Almloff 11 月之前
父節點
當前提交
9479d2376d
共有 1 個文件被更改,包括 7 次插入7 次删除
  1. 7 7
      packages/core/src/runtime.rs

+ 7 - 7
packages/core/src/runtime.rs

@@ -334,19 +334,19 @@ use dioxus::prelude::*;
 static COUNT: GlobalSignal<i32> = 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}}\");
+        }});
+    }})
+}}
 ```"
         )
     }