diff --git a/examples/multiwindow.rs b/examples/multiwindow.rs index 9d85c4cb0..f75b258ee 100644 --- a/examples/multiwindow.rs +++ b/examples/multiwindow.rs @@ -12,7 +12,8 @@ fn app(cx: Scope) -> Element { div { button { onclick: move |_| { - window.new_window(popup, (), Default::default()); + let dom = VirtualDom::new_with_props(app, props); + window.new_window(dom, Default::default()); }, "New Window" } diff --git a/packages/desktop/src/desktop_context.rs b/packages/desktop/src/desktop_context.rs index 35929cd9a..2a8e1b069 100644 --- a/packages/desktop/src/desktop_context.rs +++ b/packages/desktop/src/desktop_context.rs @@ -4,7 +4,6 @@ use std::rc::Rc; use crate::eval::EvalResult; use crate::events::IpcMessage; use crate::Config; -use dioxus_core::Component; use dioxus_core::ScopeState; use dioxus_core::VirtualDom; use serde_json::Value; @@ -78,8 +77,7 @@ impl DesktopContext { } /// Create a new window using the props and window builder - pub fn new_window(&self, app: Component, props: T, cfg: Config) { - let dom = VirtualDom::new_with_props(app, props); + pub fn new_window(&self, dom: VirtualDom, cfg: Config) { self.pending_windows.borrow_mut().push((dom, cfg)); self.proxy .send_event(UserWindowEvent(EventData::NewWindow, self.id()))