-
-
Notifications
You must be signed in to change notification settings - Fork 23
Open
Description
Here is a simple code that has a chaning state inside a composable function, which triggering the whole function recomposing.
@TraceRecomposition(tag = "State")
@Composable
fun RecompositionState(tag: String) {
var state by remember {
mutableIntStateOf(0)
}
LaunchedEffect(Unit) {
while(true) {
state += 1
delay(1.seconds)
}
}
Text(text = "tag $state")
}Currently, @TraceRecomposition only reports that this function is recomposing and the parameter tag is stable:
[Recomposition #3] RecompositionState (tag: State)
ββ tag: kotlin.String stable (state)
[Recomposition #4] RecompositionState (tag: State)
ββ tag: kotlin.String stable (state)
[Recomposition #5] RecompositionState (tag: State)
ββ tag: kotlin.String stable (state)
[Recomposition #6] RecompositionState (tag: State)
ββ tag: kotlin.String stable (state)
It would be nice if it can print out that it is changing of state that triggering the recomposition.