HEEx Templates in Phoenix Live View
Phoenix LiveView will release a new template HEEX
in the next version 0.16.0
. With that we can create reusable view components like:
defmodule MyComponent do
use Phoenix.Component
def btn(assigns) do
~H"""
<%= @text %>
"""
end
end
Then using like:
So cool!
Tweet