# Modifying "parent state" from child page in an elm-spa-example-like architecture

**URL:** <https://discourse.elm-lang.org/t/modifying-parent-state-from-child-page-in-an-elm-spa-example-like-architecture/2437>\
**Category:** Learn\
**Created:** [November 3, 2018, 11:02pm UTC](https://discourse.elm-lang.org/t/modifying-parent-state-from-child-page-in-an-elm-spa-example-like-architecture/2437 "2018-11-03T23:02:21Z")\
**Posts on this page:** 1\
**Showing post:** 16

<div class="post-metadata">

**Author:** ![glennsl](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/glennsl/32/1496_2.png) [@glennsl](https://discourse.elm-lang.org/u/glennsl)\
**Post date:** [November 10, 2018, 4:53pm UTC](https://discourse.elm-lang.org/t/modifying-parent-state-from-child-page-in-an-elm-spa-example-like-architecture/2437/16 "2018-11-10T16:53:32Z")

</div>

> [@roovo](#):
>
> I’ve approached these by adding them to the page view functions so they have a type signature of:
> 
> ```auto
> view : Model -> { title : String, content : Html Msg, modal : Maybe (Html Msg) }
> 
> ```

Yes, this is what I’m doing now as well. Passing `Html` in the model doesn’t work well if you need it to actually change with the model as well. The problem (or rather annoyance) I have with this approach is that you either have to thread the modal through quite a few view functions and/or move the code far from where it belongs. And in my case the “modals” are actually dropdown menus that have trigger buttons which change depending on what you do with the dropdown, exacerbating the problem.

---

_[View the full topic](https://discourse.elm-lang.org/t/modifying-parent-state-from-child-page-in-an-elm-spa-example-like-architecture/2437)._
