From 083ccd765ca64a3b3d6a723448206fd3f0eb5f82 Mon Sep 17 00:00:00 2001 From: Evan Almloff Date: Sun, 10 Sep 2023 13:23:29 -0500 Subject: [PATCH] fix formatting --- packages/core/src/runtime.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/core/src/runtime.rs b/packages/core/src/runtime.rs index d06818673..07aeb7c24 100644 --- a/packages/core/src/runtime.rs +++ b/packages/core/src/runtime.rs @@ -14,22 +14,24 @@ pub fn in_runtime(runtime: Rc, f: impl FnOnce() -> R) -> R { } /// Override the current runtime. This must be used to override the current runtime when importing components from a dynamic library that has it's own runtime. -/// +/// /// ```rust /// use dioxus::prelude::*; -/// +/// /// fn main() { /// let virtual_dom = VirtualDom::new(app); /// } -/// +/// /// fn app(cx: Scope) -> Element { /// render!{ Component { runtime: Runtime::current().unwrap() } } /// } -/// +/// /// // In a dynamic library /// #[inline_props] -/// fn Component(cx: Scope, runtime: Rc) -> Element { +/// fn Component(cx: Scope, runtime: std::rc::Rc) -> Element { /// cx.use_hook(|| override_runtime(runtime.clone())); +/// +/// render! { div {} } /// } /// ``` pub fn override_runtime(runtime: Rc) {