Registers nested Phlex components as callable helpers.
Elixir counterpart to Phlex Ruby Kit. Because Elixir has no const_added
hook, kits register components explicitly with kit_component/1:
defmodule MyApp.Components do
use Phlex.Kit
defmodule SayHi do
use Phlex.HTML
defstruct [:name, times: 1]
def view_template(assigns, state) do
# ...
end
end
kit_component SayHi
endImport or use the kit from another component to get say_hi/1-3 helpers.
Calling those helpers outside a render that starts with %Phlex.SGML.State{}
raises, matching Ruby kit guard behavior.
Summary
Functions
Registers a component module under a helper name.