A possible workaround is to create a event listener and render the entire component and send it via an event to js.
https://hexdocs.pm/phoenix_live_view/js-interop.html#event-listeners
https://hexdocs.pm/phoenix_live_view/Phoenix.LiveView.html#push_event/3
socket
|> push_event(
"update_table_html",
%{
tableString:
Table.render(new_assigns)
|> Phoenix.HTML.Safe.to_iodata()
|> Enum.join()
}
)
Inside the event listener replace the current html with the new one.
window.addEventListener(`phx:update_table_html`, (e) => {
document.getElementById(element).innerHTML = e.detail.new_html;
})
Dunno how much this way decreases performance, but i´ve in production and didnt notice a decrease (yet).
Guess it shouldn´t be a problem for smaller components.