I updated a project to the latest Phoenix LiveView 0.17.2 and can’t figure out how to pass assigns to a LiveComponent. I guess I need some kind of “spread operator” here, but don’t know the proper syntax.
# Sets an `assigns` assign on the `assigns` of the LiveComponent (got it? :D)
# So, in the LiveComponent I have now `assigns.assigns.my_var` instead of
# having @my_var or assigns.my_var
<.live_component module={Web.AddressChangeLive.ChangeComponent}, id="change-component", assigns />
# In this case, `module` and `id` are `nil`
<.live_component Map.merge(assigns, %{module={Web.AddressChangeLive.ChangeComponent}, id="change-component"}) />
But generally, you should pass to your components only the data it uses (not all the assigns map)
Also note that the commas are removed (normal HTML attributes)
Nooo! I was confused since your post was at the top, but the timestamp was later and I was on the phone and just thought maybe it’s a problem with a spotty connection I accepted your answer now