# How to change the component property values from custom module SDK

**URL:** <https://forum.inductiveautomation.com/t/how-to-change-the-component-property-values-from-custom-module-sdk/57836>\
**Category:** Module Development\
**Tags:** sdk, ignition80\
**Created:** [March 30, 2022, 8:22pm UTC](https://forum.inductiveautomation.com/t/how-to-change-the-component-property-values-from-custom-module-sdk/57836 "2022-03-30T20:22:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Manu\_Balakrishnan](https://avatars.discourse-cdn.com/v4/letter/m/a3d4f5/32.png) [@Manu\_Balakrishnan](https://forum.inductiveautomation.com/u/Manu_Balakrishnan)\
**Post date:** [March 30, 2022, 8:22pm UTC](https://forum.inductiveautomation.com/t/how-to-change-the-component-property-values-from-custom-module-sdk/57836/1 "2022-03-30T20:22:39Z")

</div>

Scenario -  
I’m developing a custom module using Ignition SDK, which is going to be used a perspective component.  
That component takes object as input value. I’m using ReactJS to render the UI component.  
Issue -  
I’m trying to write back the property value from ReactJS custom component, but it is not changing the value on Ignition Designer. Please share your thought.  
For e.g. The value from Ignition Designer is {“name”: “test”, “location”: “abc”}  
I’m trying to change that from ReactJS component based on button click event… like  
{“name”:“changed”, “location”:“new location”}

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [March 31, 2022, 6:56am UTC](https://forum.inductiveautomation.com/t/how-to-change-the-component-property-values-from-custom-module-sdk/57836/2 "2022-03-31T06:56:40Z")

</div>

Check out the sdk on the git

To change props you can use` PropertyTree.write()`  
in the meta you should have something like this

```auto
getPropsReducer(tree: PropertyTree): yourProps {
    return {
      setLocation:(text: string) => {tree.write("location",text);},
      setName:(text: string) => {tree.write("name",text);},
    };
  }

```

and you button onclick event can call these:  
`this.props.props.setName("Victor")`

---

<div class="post-metadata">

**Author:** ![Manu\_Balakrishnan](https://avatars.discourse-cdn.com/v4/letter/m/a3d4f5/32.png) [@Manu\_Balakrishnan](https://forum.inductiveautomation.com/u/Manu_Balakrishnan)\
**Post date:** [March 31, 2022, 8:45pm UTC](https://forum.inductiveautomation.com/t/how-to-change-the-component-property-values-from-custom-module-sdk/57836/3 "2022-03-31T20:45:20Z")

</div>

Thank you @victordcq

I’m able to change the property from SDK.

I’m referring to [ignition-sdk-examples/perspective-component at master · inductiveautomation/ignition-sdk-examples · GitHub](https://github.com/inductiveautomation/ignition-sdk-examples/tree/master/perspective-component)  
Is this correct one?

```auto
getPropsReducer(tree: PropertyTree): any {
        return {          
            setInterval: (val: number) => { tree.write("interval", val); },
            setTagValue: (obj: any) => { tree.write("tagValue", obj); }
        };
    }

```

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [April 1, 2022, 8:01am UTC](https://forum.inductiveautomation.com/t/how-to-change-the-component-property-values-from-custom-module-sdk/57836/4 "2022-04-01T08:01:38Z")

</div>

Yes looks good to me
