LiveComponent flashes - should the parent LiveView be rendering a flash added in the component?

I’ve added a flash in a LiveComponent and first expected it to render in the parent LiveView but the flashes seem to be localized to the component socket. No worries, I rendered the flashes in the content of the component as well. I thought all was good but then noticed that phx-click="lv:clear-flash" does not clear the LiveComponent flash.

  1. Should the parent LiveView be rendering a flash added in the component (preferred) and
  2. If not, should I be able to dismiss the flash in this manner?

@cschilbe Have you added phx-target="<%= @myself %>" to ensure the phx-click event goes to the component and not the parent LV?

Of course - thanks @APB9785

1 Like