how can I preview my compose multiplatform compone...
# multiplatform
r
how can I preview my compose multiplatform components? I was only able to use @Preview in androidApp module, but still, don’t see the preview tab, any ideas?
m
I think for now the best (and only) solution is to create android-only project and copy-paste your composables there. Then use preview and other tools (recomposition counter, animataions preview etc.) from there. 🤷
there is preview for desktop https://plugins.jetbrains.com/plugin/16541-compose-multiplatform-ide-support but it is pretty limited compared to what AS can do 😄
r
hmm, doesn’t sound efficient 😕 but I heard preview works in androidMain.
m
Let me know if you manage to make it work. I was struggling with it some time ago so maybe it is possible now 😄
1
t
Compose multiplatform have preview tool but just for desktop taget. I think they will update for android and ios in the future. But for now we do not have any tools to do that. A possible solution is to create a preview function in the android source set, then wrapping the compose multiplatform code and preview by jetpack compose tool.
To be honest I don't even use the preview tool of jetpack compose, because it's horrible. 😅 . Building a preview by eyes and imagination is much better 🤣
1
👎 1
r
yeah… will probably start previewing in my android app module (not the one in shared) I don’t use it much either cuz its bad, but at least wanna have a look at the preview when I open an already built screen to have an idea of all the componenets