Is `remember` supposed to be usable with the `by` ...
# compose-desktop
g
Is
remember
supposed to be usable with the
by
keyword like below?
Copy code
var loadingState by remember { mutableStateOf(Startup.LOADING) }
I am not able to use it most of the time and the IDE reports the error:
Type 'TypeVariable(T)' has no method 'getValue(Nothing?, KProperty<*>)' and thus it cannot serve as a delegate
In compose examples I see
remember
used with the
by
keyword, am I missing something? Here's my imports:
Copy code
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
1
a
You need to import
androidx.compose.runtime.get(set)Value
g
Thanks that fixed it
y
I have ran into this issue many many times... for the uninitiated, the error message looks as clear and helpful as a template error message in C++...