Packages
Phoenix.React is use for renders React component as Phoenix Component in heex template. Support render_to_string and render_to_static_markup and cache render result. Only render to string support hyrate react component with phx-hook.
Current section
Files
Jump to
Current section
Files
lib/phoenix/react/superviser.ex
defmodule Phoenix.React.Superviser do
use Supervisor
def start_link(init_arg) do
Supervisor.start_link(__MODULE__, init_arg, name: __MODULE__)
end
@impl true
def init(_init_arg) do
children = [
{Task.Supervisor, name: Pohoenix.React.RenderTaskSupervisr},
{Phoenix.React.Cache, []},
{Phoenix.React.Server, []}
]
Supervisor.init(children, strategy: :one_for_one)
end
end