:after_render hooks are currently supported in LiveComponents.
But the code below doesn’t output anything after the component is rendered. What am I doing wrong?
def mount(_params, _session, socket) do
attach_hook(socket, :after_render_hook, :after_render, fn
evt, params, socket ->
Hey @borisgoro the
mount/3 function you show doesn’t look like the mount function for a live component, it looks like one for a live view. LiveComponent mount functions are single arity. If you change it to
mount(socket) what do you get?
Can you show your whole module?
Ha yes, thank you! I copy/pasted the code from
attach_hook/4 documentation and didn’t notice it was for a LiveView. All working fine now. Thanks again!