In which task and step of the codelab can this issue be found?
5
Describe the problem
import androidx.compose.runtime.MutableState
import androidx.compose.runtime.mutableStateOf
var amountInput: MutableState<String> = mutableStateOf("0")
This part of the code, that appears in the codelab, seems to indicate that amountInput should be a static value that appear at the top level.
This is even more confusing because, in this case, the code actually works as expected, value is remembered during recomposition.
So it would be better to separately state to use a mutableState and to import those packages
URL of codelab https://developer.android.com/codelabs/basic-android-kotlin-compose-using-state?continue=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-compose-unit-2-pathway-3%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fbasic-android-kotlin-compose-using-state#4
In which task and step of the codelab can this issue be found? 5
Describe the problem
This part of the code, that appears in the codelab, seems to indicate that
amountInput
should be a static value that appear at the top level. This is even more confusing because, in this case, the code actually works as expected, value is remembered during recomposition.So it would be better to separately state to use a
mutableState
and to import those packages