const Component = () => <div></div>
export const MyComponent = withChildren(Component);
Builder.registerComponent(MyComponent, {
name: "Above",
defaultChildren: [
{
"@type": "@builder.io/sdk:Element",
component: {
name: "Heading",
options: {
text: "You can edit the contents of this example!",
type: "h4",
},
},
}
],
});
I am currently trying to make a custom component which acts as a wrapper for all other components in my ReactJS app. This code snippet does not appear to display the Heading and only appears when I edit the JSX in Builder by adding a random space and saving it, which then creates a box.
When I try to add another Builder element, Image, to my custom component, it renders as 0px height as well. I have tried setting my custom component. I have also tried doing const Component = () => <div style={{height:"auto"}}></div>
but it still renders as 0px height.
Can I know what I am doing wrong? Thanks in advance!