https://kotlinlang.org logo
#compose
Title
# compose
k

Klaas Kabini

08/06/2020, 12:00 PM
Updated to dev16 today and I cannot do this anymore. Why is mutableStateOf not allowing property delagates anymore? Am i missing something?
Copy code
class Position(x: Int, y: Int) {
    var x by mutableStateOf(x)
    var y by mutableStateOf(y)
}
g

gildor

08/06/2020, 12:28 PM
Maybe wrong import?
k

Klaas Kabini

08/06/2020, 12:30 PM
The import is androidx.compose.runtime.mutableStateOf
Probably it will suggest import if you press alt + enter on
by
1
r

romainguy

08/06/2020, 3:13 PM
I found the same issue
The fix apparently is to import androidx.compose.runtime.*
@Leland Richardson [G] fyi
k

Klaas Kabini

08/06/2020, 3:17 PM
Thank you @romainguy it works now with your suggestion
l

Leland Richardson [G]

08/06/2020, 3:19 PM
This isn't intended and might be a bug with kotlin 1.4.
2 Views