Many LiveComponents, inside of a live view - can't figure out submission events

The docs are not consistent regarding variable assignment inside live templates.

This one says:

To sum up:

  1. Avoid passing block expressions to library and custom functions
  2. Never do anything on def render(assigns) besides rendering a template or invoking the ~L sigil
  3. Avoid defining local variables, except within for , case , and friends

And this one literally suggests defining a local variable just like you did:

<%= f = form_for @changeset, "#" %>
  <%= live_component @socket, SomeComponent, f: f %>
</form>

Only a few days ago I posted this question about the same subject.
I don’t know exactly what is the rationale or the right thing to do.

1 Like