-
Notifications
You must be signed in to change notification settings - Fork 152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for LiveViewNative? #708
Comments
So gave it a shot and the good news is that it mostly works! :) Surface and LiveViewNative happily live side by side in components and views. E.g.:
The only thing that doesn't seem to work is collocating This works in the meantime, though I'd still prefer being able to have separate files:
|
This seems the relevant code in Surface: https://github.com/surface-ui/surface/blob/v0.11.0/lib/surface/renderer.ex And in LVN:
I'm happy to give it a go, though some guidance on how to best integrate them would be helpful! |
i think it mostly works, the main issue RN is layouts, me thinks. |
@noozo I had no issues doing this for the live layout: defmodule MyApp.Web.LayoutLive do
use Surface.Component
use LiveViewNative.Component
def render(%{platform_id: :swiftui} = assigns) do
# This renders a layout for the iOS/Mac app
~SWIFTUI"""
<VStack>
<%= @inner_content %>
</VStack>
"""
end
def render(assigns) do
# This layout renders for the web (with Surface)
~F"""
<div
id="layout_live"
[...] |
With the LiveViewNative 0.2 beta, there's a PR to get layouts working: liveview-native/live_view_native#108 |
As LVN is almost ready for production I was wondering if anyone's tried using Surface for it, and if not yet doable what changes would be needed?
One aspect of it would be being able to have multiple markup files for the same component/view:
The text was updated successfully, but these errors were encountered: