Hi guys! Did anyone encounter this unexpected warning in liveview?
So I have a live component:
<%= live_component @socket, ModalComponent,
id: "candidate-language-modal",
changeset: Candidate.changeset(@candidate),
open_modal?: @open_modal == "candidate-language-modal",
key: :candidate,
phx_submit: "direct_update_candidate:candidate-language-
modal",
current_user: @current_user,
candidate: @candidate do
new_assigns -> render "modal/language.html", new_assigns
end %>
But every time I compile it shows a warning that says: variable “assigns” is unused (if the variable is not meant to be used, prefix it with an underscore)
It seems this happened when we upgrade liveview from 0.14.8 to 0.15.3. Inside ModalComponent we have:
def render(%{open_modal?: true} = assigns) do
~L"""
<div>
<%= render_block(@inner_block, assigns) %>
</div>
"""
end
def render(assigns) do
~L"""
<div></div>
"""
end
Thanks in advance