LiveViewNative.Extensions.Render (live_view_native v0.0.4)
LiveView Native extension for swapping the render/1
function when rendering
for specific platforms from a LiveView or Live Component. Using this macro causes
a module to inherit a render_native/1
function which takes a map of assigns and
calls render/1
on the render module for the calling platform as defined by the
LiveViewNativePlatform.Context
struct set to the :native
assign. The module
where that platform-specific render/1
function lives is derived by concatenating
the LiveView or LiveComponent's module name with the platform context struct's
template_namespace
and should be automatically generated from a LiveView or Live
Component that uses LiveViewNative.LiveView
or LiveViewNative.LiveComponent
respectively.
This extension effectively allows a native-enabled LiveView or Live Component to support a distinct render context for each platform, allowing for platform-specific templates, modifiers, etc.