# Allow custom component to refresh when input change in editor

**URL:** <https://forum.builder.io/t/allow-custom-component-to-refresh-when-input-change-in-editor/6980>\
**Category:** Technical Questions\
**Tags:** visual-editor, nextjs\
**Created:** [December 16, 2024, 8:45pm UTC](https://forum.builder.io/t/allow-custom-component-to-refresh-when-input-change-in-editor/6980 "2024-12-16T20:45:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tlee-pb](https://avatars.discourse-cdn.com/v4/letter/t/7ba0ec/32.png) [@tlee-pb](https://forum.builder.io/u/tlee-pb)\
**Post date:** [December 16, 2024, 8:45pm UTC](https://forum.builder.io/t/allow-custom-component-to-refresh-when-input-change-in-editor/6980/1 "2024-12-16T20:45:55Z")

</div>

**Builder content link**

> **[Builder.io: Visual Development Platform](https://builder.io/content/75e3b171df21440eab89f554880c1b7b/edit?activeDesignerTab=0)**
>
> Builder is the only Visual Development Platform that offers an AI-powered design-to-code tool, a visual editor and an enterprise CMS.

**Builder public api key**  
1d8ecee591ac4358befb8fe998100548

**What are you trying to accomplish**  
Is there any way to listen to the onChange event when input field is updated in Builder editor? I created a custom component that has input field for address that can show map, but in order for the map to generate to the latest address in the editor, I have to click the refresh.

**Screenshots or video link**  
[1d8ecee591ac4358befb8fe998100548](https://www.loom.com/share/eb8ba75b3ea64996bd7bac1ab0d514c8)

**Code stack you are integrating Builder with**  
_e.g. NextJS, react, Shopify_

---

<div class="post-metadata">

**Author:** ![sheema](https://avatars.discourse-cdn.com/v4/letter/s/e19adc/32.png) [@sheema](https://forum.builder.io/u/sheema)\
**Post date:** [December 20, 2024, 4:03pm UTC](https://forum.builder.io/t/allow-custom-component-to-refresh-when-input-change-in-editor/6980/2 "2024-12-20T16:03:31Z")

</div>

Hey @tlee-pb please share the code of your custom component with me to investigate this.

---

<div class="post-metadata">

**Author:** ![tlee-pb](https://avatars.discourse-cdn.com/v4/letter/t/7ba0ec/32.png) [@tlee-pb](https://forum.builder.io/u/tlee-pb)\
**Post date:** [December 20, 2024, 4:13pm UTC](https://forum.builder.io/t/allow-custom-component-to-refresh-when-input-change-in-editor/6980/3 "2024-12-20T16:13:25Z")

</div>

Hello Sheema,

Thanks for the reply. I resolved by spreading the props in my wrapper component like the following:

```auto
<CustomComponent attr={attr} {...rest}>
   {children}
</CustomComponent>

```
