Create a React component that allows components that use withChildren
to render a drop zone when no children are present.
This would help in the case when the defaultChildren are deleted or not present.
import { ChildDropZone, withChildren } from '@builder/react';
function CustomSection(props) {
return (
<div {...props.attributes}>
<ChildDropZone children={props.children} />
</div>
);
}
export default withChildren(CustomSection);
Thanks @steve - I'll give that a try. I think I tried a slightly different version of what you've provided, so we'll see!
I think the ideal solution here is the BuilderBlocks component, which does what you are looking for
try this:
Hi there!
Thank you for reaching out to our team with this idea. This is already similarly possible with the "blocks" subField. Your users will need to drop a block into the slot once the component is placed on the page. https://forum.builder.io/t/how-to-add-dynamic-editing-regions-to-custom-components/1323
Does this match your use-case needs? If not, please let us know how you're envisioning the behavior of this Idea and how it might be different. Thank you!