ClickToComponent (Click To Component v0.1.1)

Documentation for ClickToComponent.

Summary

Functions

Installs the global on_mount/1 LiveView hook for handling events.

Renders the ClickToComponent hook.

Functions

Link to this macro

install_hooks()

(macro)

Installs the global on_mount/1 LiveView hook for handling events.

Add to your lib/my_app_web.ex file as follows:

def live_view(opts \ []) do
  quote do
    use Phoenix.LiveView,
      layout: {MyAppWeb.Layouts, :app}

    require ClickToComponent
    ClickToComponent.install_hooks()

    # Rest of live_view quoted code...
  end
end
Link to this macro

render(assigns)

(macro)

Renders the ClickToComponent hook.

Add to your lib/my_app_web/layouts/root.html.heex file as follows:

<body>
  <!-- Rest of layout body markup... -->
  <ClickToComponent.render />
</body>