Is it possible to get @Preview working when using compose-multiplatform? It is very convenient to edit the composable and see the changes in real-time. If I put the preview function outside of the common module into the Android module, it is almost useless.
👍 2
➕ 2
w
Wout Werkman
12/18/2023, 9:04 PM
The current workaround is to use Compose for Desktop previews in a JVM target. All desktop previews can be previewed in Fleet and IntelliJ.
e
electrolobzik
12/18/2023, 9:30 PM
@Wout Werkman does it mean that the Preview function is stored in one module and the compose code is located in another file in the common module? does it work in Android Studio as well?
w
Wout Werkman
12/19/2023, 10:40 AM
Yes that's what it means. You'll need to add a JVM target (if you don't have it yet) and then define previews there that can call your common composables. To use it in Android Studio, you need to install the <http://[Compose%20Multiplatform%20IDE%20Support%20-%20IntelliJ%20IDEs%20Plugin%20%7C%20Marketplace](https://plugins.jetbrains.com/plugin/16541-compose-multiplatform-ide-support)|Compose Multiplatform IDE Support> plugin.
e
electrolobzik
12/19/2023, 11:36 AM
@Wout Werkman Sorry, I don’t follow. The same preview workaround already works in Android target. Are you talking about another option for the case, when there is no Android target in the project?