I'm probably missing something basic but should I ...
# decompose
j
I'm probably missing something basic but should I be able to do likes of following in common code....looks like
subscribeAsState
comes in through
com.arkivanov.decompose:extensions-compose-jetbrains
but can't use that in
commonMain
Copy code
val uiState by component.uiState.subscribeAsState()
a
It should be available in commonMain, assuming all targets are supported by that module. Do you have Wasm enabled?
j
no....getting for iOS target it seems
Copy code
> No matching variant of com.arkivanov.decompose:extensions-compose-jetbrains:2.2.2 was found. The consumer was configured to find a library for use during 'kotlin-metadata', preferably optimized for non-jvm, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native', attribute 'org.jetbrains.kotlin.native.target' with value 'ios_arm64' but:
it works if I use in compose for desktop module directly but trying atm to move some compose code in to commonMain
a
Oh, for iOS you need to use -compose-experimental version for all Decompose modules. See https://arkivanov.github.io/Decompose/getting-started/installation/#support-for-compose-for-ios-and-web-jscanvas-and-wasm
j
ah, nice...that worked thanks
👍 1