Hey there. Is there some magic trick to get Deskt...
# compose-desktop
j
Hey there. Is there some magic trick to get Desktop Preview to work? • I have the
Compose Multiplatform IDE Support
installed • I have a block of code
Copy code
@Preview
@Composable
fun SomePreview() {
    MaterialTheme {
        SomeScreen(someParam: boolean)
    }
}
But I get a forever spinning progressbar in the desktop preview window saying "Rendering preview" Am I missing something here?
Turns out it might have been an incompatible version of the plugin. Once I selected a version that was the same as the compose version, it worked "ok". I say "ok" because darn, it was slow. And there seems to be limitations to what you can preview, because I only managed to preview simple stuff. For more complex composables it timed out.
d
Hey @joakim it sounds like you worked through your issues already; one of the 'magic tricks' for me was realising that Previews currently have to go in a top-level Application module and do not play nicely from a library module - at least this is true when dealing with Kotlin Multiplatform Android/Desktop implementations. As you said; the Desktop Preview is rather limited at the moment compared to the Android one. Interactive Preview is a big miss, though it was mentioned that it is coming... sometimes you have a screeb where even the 'initial state' takes a minor bit of computation and in these cases you effectively can't preview them without interactive.