From 9745dc6788431d16ed53f773acfb01406522cb01 Mon Sep 17 00:00:00 2001 From: paku Date: Sun, 9 Jun 2024 22:37:51 +0900 Subject: [PATCH] Add element-props-with-children method --- src/element.lisp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/element.lisp b/src/element.lisp index fcca38b..45b2861 100644 --- a/src/element.lisp +++ b/src/element.lisp @@ -139,10 +139,8 @@ (element-children element)) (defmethod expand-component ((element component)) - (with-slots (type props children) element - (apply type (merge-children-into-props props children)))) + (apply (element-type element) (element-props-with-children element))) -(defun merge-children-into-props (props children) - (append props - (and children - (list :children children)))) +(defmethod element-props-with-children ((element component)) + (with-slots (props children) element + (append props (and children (list :children children)))))