Skip to content

Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.

create children of an instance

Oleg Isonen7e0f57b09f5d
diff --git a/packages/react-sdk/src/tree/create-elements-tree.tsx b/packages/react-sdk/src/tree/create-elements-tree.tsx
index bd7efd1be5..8ca8adf138 100644
--- a/packages/react-sdk/src/tree/create-elements-tree.tsx
+++ b/packages/react-sdk/src/tree/create-elements-tree.tsx
@@ -72,11 +72,18 @@ const createInstanceChildrenElements = ({
elements.push(child);
continue;
}
+ const children = createInstanceChildrenElements({
+ children: child.children,
+ breakpoints,
+ Component,
+ onChangeChildren,
+ });
const element = createInstanceElement({
instance: child,
breakpoints,
Component,
onChangeChildren,
+ children,
});
elements.push(element);
}
@@ -94,7 +101,7 @@ const createInstanceElement = ({
breakpoints: Array<Breakpoint>;
Component: (props: WrapperComponentProps) => JSX.Element;
onChangeChildren?: OnChangeChildren;
- children?: Array<JSX.Element>;
+ children?: Array<JSX.Element | string>;
}) => {
const props = {
instance,