Closed vitidev closed 3 years ago
@Composable fun RatingBar( modifier: Modifier = Modifier, value: Float = 0f, numStars: Int = 5, size: Dp = 26.dp, padding: Dp = 2.dp, isIndicator: Boolean = false, activeColor: Color = Color(0xffffd740), inactiveColor: Color = Color(0xffffecb3), stepSize: StepSize = StepSize.ONE, ratingBarStyle: RatingBarStyle = RatingBarStyle.Normal, onRatingChanged: (Float) -> Unit ) { var rowSize by remember { mutableStateOf(Size.Zero) } var rating by remember { mutableStateOf(value) }
var rating by remember { mutableStateOf(value) } knows nothing about external changes in value
var rating by remember { mutableStateOf(value) }
I'm newbie in jetpack compose, but I guess you need to rewrite the code like this
var rating by remember(value) { mutableStateOf(value) }
fixed in the v1.1.1 release. changed to state hoist pattern. so, you can check latest updated readme.
var rating by remember { mutableStateOf(value) }
knows nothing about external changes in valueI'm newbie in jetpack compose, but I guess you need to rewrite the code like this