# Unable to view changes made in custom component

**URL:** <https://forum.builder.io/t/unable-to-view-changes-made-in-custom-component/735>\
**Category:** CMS\
**Tags:** react\
**Created:** [July 2, 2021, 11:38am UTC](https://forum.builder.io/t/unable-to-view-changes-made-in-custom-component/735 "2021-07-02T11:38:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![hellovivita](https://avatars.discourse-cdn.com/v4/letter/h/3ec8ea/32.png) [@hellovivita](https://forum.builder.io/u/hellovivita)\
**Post date:** [July 2, 2021, 11:38am UTC](https://forum.builder.io/t/unable-to-view-changes-made-in-custom-component/735/1 "2021-07-02T11:38:13Z")

</div>

```auto
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!

---

<div class="post-metadata">

**Author:** ![maddy](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.builder.io/maddy/32/11_2.png) [@maddy](https://forum.builder.io/u/maddy)\
**Post date:** [July 7, 2021, 7:51pm UTC](https://forum.builder.io/t/unable-to-view-changes-made-in-custom-component/735/2 "2021-07-07T19:51:08Z")

</div>

Hi @hellovivita 👋

There are a couple of things you can resolve in your code to make your component display and function as expected.

1. Your custom component isn’t rendering with a height of 0px. Instead, the children aren’t being displayed because the children aren’t being rendered. To resolve this you can change your code to include `props.children` like this:

`const Component = (props) => <div>{props.children}</div>;`

1. The default children aren’t displaying because “Header” isn’t a default component (unless you already have a custom component named “Header”). Instead this should be text or a block and you can change the options as you see fit.

```auto
defaultChildren: [
    {
      "@type": "@builder.io/sdk:Element",
      component: {
        name: "Text",
        options: {
          text: "You can edit the contents of this example!"
       }
      }
    }
]

```

We have an open source component that has a full example of using withChildren [here](https://github.com/BuilderIO/builder/blob/@builder.io/widgets@1.2.19-alpha.1/packages/react/src/blocks/Video.tsx#L161-L299) that may be helpful. You can also view another working example [here](https://codesandbox.io/s/affectionate-tesla-0dw1u?file=/pages/index.js).

---

<div class="post-metadata">

**Author:** ![hellovivita](https://avatars.discourse-cdn.com/v4/letter/h/3ec8ea/32.png) [@hellovivita](https://forum.builder.io/u/hellovivita)\
**Post date:** [July 8, 2021, 8:57am UTC](https://forum.builder.io/t/unable-to-view-changes-made-in-custom-component/735/3 "2021-07-08T08:57:03Z")

</div>

Thanks a lot! This was the exact problem with my code!
