ursus
02/29/2024, 11:53 PM@Composable
fun ReviewTextField( <-------------------------------
fieldName: String,
value: String,
onValueChange: (String) -> Unit,
) {
Column(
modifier = Modifier.fillMaxWidth(),
verticalArrangement = Arrangement.spacedBy(8.dp)
) {
...
OutlinedTextField( <-------------------------
modifier = Modifier
.fillMaxWidth(),
value = value,
placeholder = { Text(text = fieldName, fontWeight = FontWeight.Normal) },
onValueChange = onValueChange,
textStyle = MaterialTheme.typography.body1Strong,
singleLine = true,
...
)
}
}
Is it normal for ReviewTextField
to get recomposed everytime, even if the input don't change if it contains a OutlinedTextField
? If I turn the text field into a Text
then the parent doesn't recompose
As if TextField
was causing it to be unstable
Wtf?
// If I remove the onValueChange
lambda, then it stops recomposing even with OutlinedTextField
there .. is lambda making the whole thing non skippable?agrosner
03/01/2024, 12:50 AMursus
03/01/2024, 12:51 AMagrosner
03/01/2024, 12:51 AMursus
03/01/2024, 12:51 AMagrosner
03/01/2024, 12:51 AMagrosner
03/01/2024, 12:52 AMursus
03/01/2024, 12:52 AMagrosner
03/01/2024, 12:52 AMursus
03/01/2024, 12:52 AMagrosner
03/01/2024, 12:53 AMagrosner
03/01/2024, 12:53 AMursus
03/01/2024, 12:54 AMonValueChanges = viewModel::valueChanged
ursus
03/01/2024, 12:54 AMursus
03/01/2024, 12:54 AMagrosner
03/01/2024, 12:54 AMursus
03/01/2024, 12:55 AMursus
03/01/2024, 12:56 AMagrosner
03/01/2024, 1:23 AM