summary refs log tree commit diff
path: root/src/render.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/render.rs')
-rw-r--r--src/render.rs8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/render.rs b/src/render.rs
index 94b193b..8addbdb 100644
--- a/src/render.rs
+++ b/src/render.rs
@@ -4,7 +4,7 @@ use std::future::Future;
 use futures::future::join_all;
 
 pub trait Component {
-    fn render(self: Box<Self>) -> Vec<RenderNode>;
+    fn render(self: Box<Self>) -> RenderNode;
 }
 
 pub enum RenderNode {
@@ -31,11 +31,9 @@ impl RenderNode {
     pub(crate) fn render_to_string(self) -> Pin<Box<dyn Future<Output = String>>> {
         match self {
             RenderNode::Component(component) => {
-                let elements = component.render();
+                let result_root = component.render();
                 Box::pin((async move || {
-                    join_all(elements.into_iter()
-                        .map(|child| child.render_to_string())
-                        .collect::<Vec<_>>()).await.join("")
+                        result_root.render_to_string().await
                 })())
             },