fix(runtime): Column node added a div with empty Repeater (#45)

When the Column node only had an empty Repeater child, there was an empty HTML element.
This commit is contained in:
Eric Tuvesson
2024-06-27 21:16:50 +02:00
committed by Richard Osborne
parent 1d295c9462
commit 22058e9016

View File

@@ -115,7 +115,10 @@ export function Columns(props: ColumnsProps) {
// ForEachCompoent breaks the layout but is needed to send onMount/onUnmount
if (!Array.isArray(props.children)) {
children = [props.children];
// @ts-expect-error props.children.type is any
if (props.children.type !== ForEachComponent) {
children = [props.children]
}
} else {
children = props.children.filter((child) => child.type !== ForEachComponent);
forEachComponent = props.children.find((child) => child.type === ForEachComponent);