# Best way to update 'options' prop in custom renderer (Autocomplete)

**URL:** <https://jsonforms.discourse.group/t/best-way-to-update-options-prop-in-custom-renderer-autocomplete/1659>\
**Category:** General\
**Created:** [August 10, 2023, 11:52am UTC](https://jsonforms.discourse.group/t/best-way-to-update-options-prop-in-custom-renderer-autocomplete/1659 "2023-08-10T11:52:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![richkroll](https://yyz2.discourse-cdn.com/free1/user_avatar/jsonforms.discourse.group/richkroll/32/512_2.png) [@richkroll](https://jsonforms.discourse.group/u/richkroll)\
**Post date:** [August 10, 2023, 11:52am UTC](https://jsonforms.discourse.group/t/best-way-to-update-options-prop-in-custom-renderer-autocomplete/1659/1 "2023-08-10T11:52:20Z")

</div>

I have created a custom renderer to populate dependent select lists. I am using an Autocomplete control and am attempting to populate it from data returned from an API. I am using useEffect() to load the data from the remote API but have run into an issue into how to populate the options of the control. The options prop is read only and if I create a local ‘options/setOptions’ state to manage the state and then use handleChange, the JSONForms data is populated correctly, but the form control still contains the original selected value. What is the correct way to expose the data to JSONForms and associated controls?

---

<div class="post-metadata">

**Author:** ![richkroll](https://yyz2.discourse-cdn.com/free1/user_avatar/jsonforms.discourse.group/richkroll/32/512_2.png) [@richkroll](https://jsonforms.discourse.group/u/richkroll)\
**Post date:** [August 14, 2023, 1:10pm UTC](https://jsonforms.discourse.group/t/best-way-to-update-options-prop-in-custom-renderer-autocomplete/1659/2 "2023-08-14T13:10:56Z")

</div>

Please disregard this post. I had a mistake in my underlying code and using options/setOptions worked as expected.

---

<div class="post-metadata">

**Author:** ![mohamedali69](https://yyz2.discourse-cdn.com/free1/user_avatar/jsonforms.discourse.group/mohamedali69/32/799_2.png) [@mohamedali69](https://jsonforms.discourse.group/u/mohamedali69)\
**Post date:** [August 15, 2023, 8:11am UTC](https://jsonforms.discourse.group/t/best-way-to-update-options-prop-in-custom-renderer-autocomplete/1659/3 "2023-08-15T08:11:15Z")

</div>

Hello rick can you share with me your code to see how you are updating the props inside your custom renderer .

---

<div class="post-metadata">

**Author:** ![richkroll](https://yyz2.discourse-cdn.com/free1/user_avatar/jsonforms.discourse.group/richkroll/32/512_2.png) [@richkroll](https://jsonforms.discourse.group/u/richkroll)\
**Post date:** [August 15, 2023, 12:30pm UTC](https://jsonforms.discourse.group/t/best-way-to-update-options-prop-in-custom-renderer-autocomplete/1659/4 "2023-08-15T12:30:20Z")

</div>

You can see (mostly) working code [here](https://jsonforms.discourse.group/t/how-to-update-another-control/1661).
