l

    loloof64

    1 year ago
    In compose 1.0.0-alpha07, I am adding this line in my composable, but I get an error saying that I can't set up remember as a delegate:
    var boardReversed by remember { mutableStateOf(false) }
    
    => Type 'TypeVariable(T)' has no method 'getValue(Nothing?, KProperty<*>)' and thus it cannot serve as a delegate
    Meanwhile, I just followed the documentation : https://developer.android.com/jetpack/compose/state#use-rememeber-to-create-internal-state-in-composable
    s

    selcukbulca

    1 year ago
    Have you tried importing
    import androidx.compose.runtime.getValue
    ?
    l

    loloof64

    1 year ago
    Oups ! I read too fast (again). Indeed the documentation states this fact. Thank you again 😃
    Also, I need
    import androidx.compose.runtime.setValue
    s

    selcukbulca

    1 year ago
    Yeah, since you made it mutable 👍
    a

    allan.conda

    1 year ago
    nah it’s understandable, IDE is failing to import it automatically currently