# How to propagate a click event of a custom button on a custom control to outside of Jsonform

**URL:** <https://jsonforms.discourse.group/t/how-to-propagate-a-click-event-of-a-custom-button-on-a-custom-control-to-outside-of-jsonform/804>\
**Category:** General\
**Created:** [June 5, 2022, 1:00pm UTC](https://jsonforms.discourse.group/t/how-to-propagate-a-click-event-of-a-custom-button-on-a-custom-control-to-outside-of-jsonform/804 "2022-06-05T13:00:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![davidxwwang](https://yyz2.discourse-cdn.com/free1/user_avatar/jsonforms.discourse.group/davidxwwang/32/347_2.png) [@davidxwwang](https://jsonforms.discourse.group/u/davidxwwang)\
**Post date:** [June 5, 2022, 1:00pm UTC](https://jsonforms.discourse.group/t/how-to-propagate-a-click-event-of-a-custom-button-on-a-custom-control-to-outside-of-jsonform/804/1 "2022-06-05T13:00:05Z")

</div>

![屏幕快照 2022-06-05 下午8.53.54](https://global.discourse-cdn.com/free1/uploads/jsonforms/original/1X/7e7aa6db8707b022afbe065cb239b90205d56235.png)

thanks for your great product! l have a question: l create a custom button on a custom control ,and l want to propagate the “onclick” event of the “custom button” to its parent or outside of Jsonform（eg：the class which \<JsonForms …/\> in）,how can do it, thanks!

---

<div class="post-metadata">

**Author:** ![davidxwwang](https://yyz2.discourse-cdn.com/free1/user_avatar/jsonforms.discourse.group/davidxwwang/32/347_2.png) [@davidxwwang](https://jsonforms.discourse.group/u/davidxwwang)\
**Post date:** [June 5, 2022, 1:10pm UTC](https://jsonforms.discourse.group/t/how-to-propagate-a-click-event-of-a-custom-button-on-a-custom-control-to-outside-of-jsonform/804/2 "2022-06-05T13:10:51Z")

</div>

l know there is a “handleChange” function which can propagate to its parent，but the params can only set the path and value ， l want custom other function to propagate some event（may take some custom data） to its parent， thanks！

---

<div class="post-metadata">

**Author:** ![sdirix](https://yyz2.discourse-cdn.com/free1/user_avatar/jsonforms.discourse.group/sdirix/32/1073_2.png) [@sdirix](https://jsonforms.discourse.group/u/sdirix)\
**Post date:** [June 7, 2022, 7:10am UTC](https://jsonforms.discourse.group/t/how-to-propagate-a-click-event-of-a-custom-button-on-a-custom-control-to-outside-of-jsonform/804/3 "2022-06-07T07:10:26Z")

</div>

Hi @davidxwwang,

The easiest way to do this is via [React contexts](https://reactjs.org/docs/context.html). Just set one up outside of JSON Forms, consume it within your custom renderer and then you can hand in whatever you’d like.

---

<div class="post-metadata">

**Author:** ![davidxwwang](https://yyz2.discourse-cdn.com/free1/user_avatar/jsonforms.discourse.group/davidxwwang/32/347_2.png) [@davidxwwang](https://jsonforms.discourse.group/u/davidxwwang)\
**Post date:** [June 8, 2022, 3:05pm UTC](https://jsonforms.discourse.group/t/how-to-propagate-a-click-event-of-a-custom-button-on-a-custom-control-to-outside-of-jsonform/804/4 "2022-06-08T15:05:13Z")

</div>

thanks ，best wishes！ 😀
