Is it possible to get @Preview working when using ...
# multiplatform
e
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
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
@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
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
@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?
265 Views