Is there any possibility that we don't need to imp...
# compose
l
Is there any possibility that we don't need to import
State.getValue
and
MutableState.setValue
?
j
You could not use
by
and read/write to the
value
property
l
I don't understand?
j
let’s say you have a variable named
input
instead of using:
var input by remember { mutableStateOf(…) }
and directly reading/writing to
input
you could have:
val input = remember { mutableStateOf(…) }
and you could read and write to
input.value
l
No I'm wondering why we need to import these two functions when it's more convenient if the official includes them as they are used a lot. So I'm imagining this:
Copy code
interface State<T> {
    val value: T

    operator fun getValue(/* ... */): T = value
}
'Cause sometimes IDEA just doesn't recognise when you
by
something, and you need to manually import them.