Currently following this part: <https://arkivanov....
# decompose
j
Currently following this part: https://arkivanov.github.io/Decompose/extensions/compose/#converting-value-to-state
Copy code
interface SomeComponent {
    val model: Value<Model>

    data class Model(/*...*/)
}

@Composable
fun SomeContent(component: SomeComponent) {
    val model: State<Model> by component.model.subscribeAsState()
}
I think I have the same, but it’s throwing an error:
Copy code
interface LoginComponent {
    val model: Value<Model>

    data class Model(
        val username: String,
        val password: String,
    )

    fun onSubmit(username: String, password: String)
}
Copy code
import androidx.compose.runtime.State
import androidx.compose.runtime.getValue

@Composable
fun LoginScreen(component: LoginComponent, modifier: Modifier = Modifier) {
    val model: State<LoginComponent.Model> by component.model.subscribeAsState()

///
Property delegate must have a ‘getValue(Nothing?, KProperty<*>)’ method. None of the following functions is suitable:
public inline operator fun <T> State<LoginComponent.Model>.getValue(thisObj: Any?, property: KProperty<*>): LoginComponent.Model defined in androidx.compose.runtime
I’m probably missing something obvious 🤔