Hello, Could someone explain me why the `TextField...
# compose
a
Hello, Could someone explain me why the
TextFieldColors
functions all return
State
and not a color directly? For instance, I don't see why the function below couldn't omit the
rememerUpdatedState
and only keep the
if
, since on recompositions it would be called again, thus returning a different value
Copy code
@Composable
    override fun textColor(enabled: Boolean): State<Color> {
        return rememberUpdatedState(if (enabled) textColor else disabledTextColor)
    }
e
as an example, some implementation could return
animateColorAsState
and by delaying reading the value it doesn't need to be recomposed on every frame