Hello Guys, Do we have anything for compose preview in shared module. I am working on a compose multiplatform project and trying to build common UI for Android and Ios Using compose. But without preview support its not that enjoyable. Any suggestions?
10/30/2023, 8:16 AM
There is not afaik. Suggestions:
1- Use the Android Previews in Android Studio and hope for the iOS target to render the same.
2- Export the Composable as a ComposeUiViewController from shared. Then embed this UiViewController in a Swift-ui View and Preview it in Xcode.
10/30/2023, 8:28 AM
I use the same approach as @Pablichjenkov, but be wary, that if you’re using multiplatform resources (for like images) that the previews don’t work (at least not for me). I started using paparazzi to generate screenshots and then check them using the browser
10/30/2023, 8:40 AM
Humm, interesting. I haven't tried to preview any image tbh. Did you bring that issue up?
Try asking here if it is possible, otherwise, you may open an issue in the GitHub project.
BTW thanks for the paparazzi trick.
10/30/2023, 5:57 PM
I thought I’ve found the original issue before but cant find it anymore. I’ll try to make an issue on Github when I’ll have time