# Conflit using Dry Monads and View Component

**URL:** <https://discourse.dry-rb.org/t/conflit-using-dry-monads-and-view-component/1728>\
**Category:** Support\
**Created:** [September 13, 2023, 11:42pm UTC](https://discourse.dry-rb.org/t/conflit-using-dry-monads-and-view-component/1728 "2023-09-13T23:42:03Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![alassek](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.dry-rb.org/alassek/32/314_2.png) [@alassek](https://discourse.dry-rb.org/u/alassek)\
**Post date:** [September 14, 2023, 10:24pm UTC](https://discourse.dry-rb.org/t/conflit-using-dry-monads-and-view-component/1728/3 "2023-09-14T22:24:44Z")

</div>

Taking a look at the [ViewComponent docs](https://viewcomponent.org/api.html#instance-methods), `call` is not part of the public interface. So that’s what’s happening: `Dry::Monads::Do::All` is expected a call method and you don’t have one.

Furthermore, I don’t think mixing in do-notation into a ViewComponent is a good idea. It’s meant for Operation objects that behave like functions, and isn’t really used in view logic that I’ve seen. The do-notation wraps every method defined with code that intercepts `yield`, which is a bad idea in views, `yield` is usually used for something.

The workaround you’ve already found, using `include Dry::Monads::Do.for` for specific methods should be safe to do. But if wrapping a helper method in do-notation is necessary here, then perhaps that would be better off extracted into a separate Operation.

---

_[View the full topic](https://discourse.dry-rb.org/t/conflit-using-dry-monads-and-view-component/1728)._
