compose-ratingbar
compose-ratingbar copied to clipboard
Cutom painter recomposition issue
This code has an excessive recomposition for the RatingBar when you type the text
@Composable
private fun Foo() {
Column(modifier = Modifier.padding(20.dp)) {
var rating by remember { mutableFloatStateOf(0f) }
var feedback by remember { mutableStateOf("") }
RatingBar(
value = rating,
painterEmpty = painterResource(id = R.drawable.ic_star_off),
painterFilled = painterResource(id = R.drawable.ic_star_on),
onValueChange = { rating = it },
onRatingChanged = {}
)
TextField(value = feedback, onValueChange = { feedback = it })
}
}
Painter
is unstable param. Check SO for resolve this problem.
@vvdrak thanks. will fix this