Function component JS in Live views

Hi all,

I have a function component <Module.component />.
I have some JS logic attached to that component.

If I use Module.component in a live view, I would love to run the JS logic every time the view is mounted, is that possible?

I mean, I know I can use phx-hook in a live component, but is there a solution for function components?

Thank you

phx-hook works no matter where the markup is defined/written.

1 Like

Ah, I misunderstood the docs!

It’s working like a charm