Upgrade mental block: implicit assigns in live_component do-blocks is deprecated

Hi all, I’m trying to upgrade an old project LV14 up to LV16 at least.

One of the warnings is implicit assigns in live_component do-blocks is deprecated
With an example; which I think is a brilliant helping step.

However in the case, I have a bit of a mental block on how to tackle it with the code as is. Here is an example, rightly or wrongly there is a modal component that wraps another component.

<%= live_component HillWeb.ModalComponent, id: ComponentID.modal, session_id: @session_id do %>
  <%= live_component HillWeb.MeasurementsComponent, id: :measurement_modal, session_id: @session_id, modal_data: @modal_data, path_info: [""] %>
<% end %>

I can’t quite figure out how to upgrade this to avoid implicit assigns in do-blocks. Anyone give me a clue on the missing step?

1 Like