Hi all, it's my first post here 👋
I've recently started developing an app with Compose Multiplatform and noticed that `@Preview @Composable`s defined in the
commonMain
source set don't work. Is this expected, and if not, do you plan to address it somehow?
a
Alejandro Rios
09/18/2023, 4:12 PM
@Preview
only works for JVM targets, so it should work Android/Desktop
b
Bartek Pacia
09/18/2023, 4:18 PM
Yeah, but then I have to define my composables in
shared/commonMain
, but write previews in
androidApp/main
, right? I think it's an okay-ish workaround but not perfect.
a
Alejandro Rios
09/18/2023, 4:19 PM
That's correct
a
aidanvii
09/19/2023, 10:40 AM
That's what I do, more specifically I define previews only for Android debug source set. The desktop previews are extremely limited, I would avoid them personally unless desktop is a target you actually care about.
aidanvii
09/19/2023, 10:41 AM
Android previews are much more flexible and support things like preview parameters.