# Trigger function coming from react context

**URL:** <https://forum.builder.io/t/trigger-function-coming-from-react-context/698>\
**Category:** Technical Questions\
**Tags:** feature, react\
**Created:** [June 10, 2021, 5:24pm UTC](https://forum.builder.io/t/trigger-function-coming-from-react-context/698 "2021-06-10T17:24:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jediinspace](https://avatars.discourse-cdn.com/v4/letter/j/51bf81/32.png) [@Jediinspace](https://forum.builder.io/u/Jediinspace)\
**Post date:** [June 10, 2021, 5:24pm UTC](https://forum.builder.io/t/trigger-function-coming-from-react-context/698/1 "2021-06-10T17:24:13Z")

</div>

Hi,  
I’m trying to resolve my task:  
Need to show popup which implemented inside my react app by button made within builder.  
So I’m passing setState function (with popup visibility state) inside custom action, but it doesn’t trigger anything. This function declared in context from parent component.  
Is it impossible to achieve that behavior?  
Thank you in advance!

---

<div class="post-metadata">

**Author:** ![aziz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.builder.io/aziz/32/2551_2.png) [@aziz](https://forum.builder.io/u/aziz)\
**Post date:** [June 10, 2021, 6:41pm UTC](https://forum.builder.io/t/trigger-function-coming-from-react-context/698/2 "2021-06-10T18:41:46Z")

</div>

Hi @Jediinspace , that’s definitely possible, Builder can act as an extension to your codebase, and it can have access to methods from your codebase using the context prop

```auto
const [popupOpen, setPopupOpen] = useState(false);
<BuilderComponent model="..." context={{ openPopup: () => { setPopupOpen(true)}}

```

And then in any of the action handlers in the content you can simply call that method:

```auto
context.openPopup();

```

---

<div class="post-metadata">

**Author:** ![Jediinspace](https://avatars.discourse-cdn.com/v4/letter/j/51bf81/32.png) [@Jediinspace](https://forum.builder.io/u/Jediinspace)\
**Post date:** [June 10, 2021, 6:45pm UTC](https://forum.builder.io/t/trigger-function-coming-from-react-context/698/3 "2021-06-10T18:45:39Z")

</div>

Yes, thank you, I just adjusted my question. I’ve tried to do it with local useState hook and it works fine (I used the data prop and state in builder accordingly), but what if this function came from parent component? Does builder understand full execution context?
