Live Component handle_event/3 going to *parent* instead of component itself

edit

Doh, Didn’t read the part where it said i have to explicitly make it target itself.

https://hexdocs.pm/phoenix_live_view/Phoenix.LiveComponent.html#module-targeting-component-events

Stateful components can also implement the handle_event/3 callback that works exactly the same as in LiveView. For a client event to reach a component, the tag must be annotated with a phx-target. If you want to send the event to yourself, you can simply use the @myself assign, which is an internal unique reference to the component instance:

2 Likes