Programming Phoenix LiveView: B5.0, Page 106

After update LiveView I get that warning for snippet with live_component function :slight_smile:

[W] passing the @socket to live_component is no longer necessary, 
live_component(socket, PentoWeb.ModalComponent, modal_opts)

Page 107
“”"
<%= live_component @socket, @component, @opts %>
The socket shared by the parent live view, in this case ProductLive.Index, is the
first argument to live_component/3,
“”"
Since first argument is component now
https://hexdocs.pm/phoenix_live_view/Phoenix.LiveView.Helpers.html#live_component/3

Thanks for pointing this out! We’ll be updating to the latest LiveView version and updating code samples accordingly before the book comes out of Beta.

1 Like