Is it possible to use Compose in multiplatform `co...
# compose
s
Is it possible to use Compose in multiplatform
commonMain
for all platforms (desktop, web, android)?
r
Compose for web at the moment is quite different from Compose for Desktop and Android. You can do it for Android and Desktop for a lot of the libraries (not everything though - ie ConstraintLayout in compose doesn't work on desktop at the moment), but not web.
s
ok, thanks!
j
@Rebecca Franks do you know when the canvas approach will be the default?
r
No sorry I don't know, I haven't been involved in Compose for Web other than some of my own personal explorations, it's maintained by Jetbrains.
m
@Rebecca Franks Your answer may be a little bit misleading. It definitely is “possible to use Compose in multiplatform
commonMain
for all platforms (desktop, web, android)“. One just has to keep in mind that the iOS and Web version of this is still experimental. Just have a look at these examples from Jetbrain: https://github.com/JetBrains/compose-jb/tree/master/experimental/examples
r
Thanks for the sample linking! I think when I tried some stuff didn't work so well eg some libraries like ConstraintLayout isn't supported, the Column / Row syntax didn't work and the Stylesheet syntax seems very different from Compose for Android/ Desktop. I'll take a look at those samples as they seem different in some way, thanks for linking!
s
Thanks for the link; it looks similar to what I'm trying to do
p
With wasm the api isn't different