Unlike LiveView's render/1 callback, a function component can
modify the assigns it receives via the assign/2, assign/3,
assign_new/3, and update/3 functions. Therefore, you can assign
the computed values before declaring your template.
Expected behavior
Cleanly you can:
def render(assigns) do
assigns = assign(assigns, :foo, 123)
~H"""
<%= @foo %>
"""
end
Environment
LiveView Docs v1.0.0-rc.0
Actual behavior
The docs says:
Expected behavior
Cleanly you can:
I think that should just be removed from the docs? See https://elixirforum.com/t/reassigning-assigns-in-render/64038/3 for context