# defaultValue is not updating with dynamic variable in inputs when registering custom react components in builder

**URL:** <https://forum.builder.io/t/defaultvalue-is-not-updating-with-dynamic-variable-in-inputs-when-registering-custom-react-components-in-builder/1802>\
**Category:** Technical Questions\
**Created:** [February 22, 2022, 5:17pm UTC](https://forum.builder.io/t/defaultvalue-is-not-updating-with-dynamic-variable-in-inputs-when-registering-custom-react-components-in-builder/1802 "2022-02-22T17:17:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dharmaraju](https://avatars.discourse-cdn.com/v4/letter/d/6bbea6/32.png) [@dharmaraju](https://forum.builder.io/u/dharmaraju)\
**Post date:** [February 22, 2022, 5:17pm UTC](https://forum.builder.io/t/defaultvalue-is-not-updating-with-dynamic-variable-in-inputs-when-registering-custom-react-components-in-builder/1802/1 "2022-02-22T17:17:02Z")

</div>

Trying to register our react component in builder which is accepting some props in current implementation, so how to pass/convert these props when registering the components in builder?

Currently doing in the following way using inputs but **defaultValue** is not getting updated with a **dynamic variable** inside inputs.

```auto
Builder.registerComponent(CustomComp, {
    name: 'CustomComp',
    inputs: [
      {
        name: 'inputVal',
        type: 'text',
        defaultValue: **variable**
      },
    ]
  });

```

---

<div class="post-metadata">

**Author:** ![TimG](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.builder.io/timg/32/714_2.png) [@TimG](https://forum.builder.io/u/TimG)\
**Post date:** [February 25, 2022, 7:23pm UTC](https://forum.builder.io/t/defaultvalue-is-not-updating-with-dynamic-variable-in-inputs-when-registering-custom-react-components-in-builder/1802/2 "2022-02-25T19:23:07Z")

</div>

@dharmaraju Instead of passing the variable directly you want to pass it as a template literal. So based on your above example, something like this:

```auto
let variable = 'default text';

Builder.registerComponent(CustomComp, {
    name: 'CustomComp',
    inputs: [
      {
        name: 'inputVal',
        type: 'text',
        defaultValue: `${variable}`
      },
    ]
  });

```

Try it out and let me know if that works!
