I have created a liveview with a child livecomponent (dialog). I was expecting to be able to define assigns in the child mount function but I get the error:
assign @value not available in eex template.
Please make sure all proper assigns have been set. If this
is a child template, ensure assigns are given explicitly by
the parent template as they are not automatically forwarded.
I was expecting this to work since I assign :value is in the mount function of the child component. Though, the error message suggests that the value has to be “forwarded” by the parent liveview in this case. If this is the case, I don’t understand what are the benefits of livecomponents since part of the logic still has to remain in the parent liveview with values passed to the child component when needed.
On the other hand, using two liveviews for this use case does not seem optimal as it would require the usage of PubSub. The latter seems to be more suited for broadcasting which is not something useful for simple component interactions (eg. show/hide).
Livecomponents examples I found just show simple use of them where one or two values are passed to the component but nothing with more complex livecomponents.
Thanks.






















