LiveView Hooks. What am I doing wrong?

Following along with this example from the docs:
https://hexdocs.pm/phoenix_live_view/Phoenix.LiveView.html#module-js-interop-and-client-controlled-dom

I’ve added this little test hook.

I’ve added the dom element

But I get nothing yet I can see the Hook in the LiveSocket and even call it directly.

What am I missing here?

1 Like

Looks like a typo
“mount” > “mounted”

Thanks to @ Elijah Kim for pointing this out.

4 Likes

Yes, the correct way to call is “mounted( )” :blush: