1 min readMar 1, 2020
The reason here is that in your example, `ModalLink` owns the modal view state (opened/closed) which means once it is recreated — the modal view would close.
To overcome this, we have separate objects:
- `ModalPresenter` — owns the state and presents/hides the modal. This object should live in the place that is not updated often.
- `ModalLink` — a button that can send its events to the modal presenter through the environment. It is safe to recreate or update button as often as it is needed.