Is there any way to get compose previews on intell...
# compose
r
Is there any way to get compose previews on intellij or android studio using kmp with compose for desktop & js targets? I'm not able neither with the latest version of the plugins installed.
t
You should be able to use previews in the commonMain/shared package. I don't remember if we have to enable K2 mode but I have it on.
v
Started working for me when I updated to Android Studio Narwhal. That is not yet on the "Stable channel".
r
You should be able to use previews in the commonMain/shared package. -> I have it all of them in commonMain but neither way. Will try with android studio narwhal as Vidmantas suggested
v
Also, in
commonMain
, you need to add:
Copy code
implementation(compose.components.uiToolingPreview)
+ in
androidMain
you need to add:
Copy code
implementation(compose.uiTooling)
r
I don't have android target, does it matter?
v
Dunno, but I tried adding
compose.uiTooling
to
commonMain
and it did not work for me as it did not resolve. Probably you can add that
compose.uiTooling
to some other target aswell. Desktop or something
I have Android + iOS + wasmJS, and I suppose wasmJS did not allow me to add that into commonMain, try adding it to commonMain at first.