when using `var state by remember { mutableStateOf...
# compose
m
when using
var state by remember { mutableStateOf(…) }
I get error saying there are no
get
and
set
methods BUT I have
Copy code
import androidx.compose.runtime.getValue
import androidx.compose.runtime.setValue
and they are grey, not used. same
get
and
set
methods error when using
import androidx.compose.runtime.*
Any fix?
c
Usually I delete the remember import or the whole runtime inport and reinport them 1 by 1, but keep the get and set imports
m
@Cezar Olteanu tried that, not working
f
In my experience it usually helps to define all the types and let AS import everything on its own witl Alt+Enter. So e.g.
var state by remember<MutableState<Boolean>> { mutableStateOf(true) }
m
@Filip Wiesner it worked 😄 thanks
🙌 1