The right lifecycle should be
mount/3
handle_prams/3
render/3
Could you paste a link to doc, that can confirm right livecyle, please?
From the LiveView source code:
socket =
Utils.configure_socket(
socket,
mount_private(parent, assign_new, connect_params, connect_info),
action,
flash,
host_uri
)
socket
|> Utils.maybe_call_live_view_mount!(view, params, Map.merge(socket_session, session))
|> build_state(phx_socket)
|> maybe_call_mount_handle_params(router, url, params)
|> reply_mount(from)
end
defp load_csrf_token(endpoint, socket_session) do
if token = socket_session["_csrf_token"] do
state = Plug.CSRFProtection.dump_state_from_session(token)
secret_key_base = endpoint.config(:secret_key_base)
Plug.CSRFProtection.load_state(secret_key_base, state)
From post in ElixirForum, it mentions:
handle_params is called after mount
And from the course provided by Pragmatic Studio. It mentions this order in a section, but I can’t remember which one, sorry.
Right you are! We’ll correct this in an upcoming Beta release. Thanks for pointing this out
@redrapids , I’ll update the prose but I believe you have the source file for the image on page 94. Go ahead and update then when you get a chance. Thanks!
Thanks for the heads up! This change is made and will go out in the next release.