LiveViewNative.Extensions.InlineRender (live_view_native v0.0.9-rc.1)
LiveView Native extension that enables inline-rendering of templates for LiveView
Native platforms within a LiveView or Live Component. Using this macro causes
a module to inherit a LVN/2
sigil that can be used to render templates inline
by suffixing it with the platform's platform_id
:
defmodule MyAppWeb.HelloLive do
use Phoenix.LiveView
use LiveViewNative.LiveView
@impl true
def render(%{platform_id: :swiftui} = assigns) do
~LVN"""
<Text modifiers={@native |> foreground_style(primary: {:color, :mint})}>
Hello from iOS!
</Text>
"""swiftui
end
def render(assigns) do
~H"""
<div>Hello from the web!</div>
"""
end
end