王欢
08/22/2024, 2:53 AMdata class UiState(
val dark: Boolean = false,
val showLoading: Boolean = true,
val showVisualization: Boolean = false,
val showSetting: Boolean = false
)
the compose binding this UiState by mutableStateOf(UiState()). I have a question. when a val of Uistate changed, it lead to the Compose reComposition. but some subCompose of whole Compose also will ReComposition , actually the val don't changed. for example ComposeAll including ComposeA and ComposeB which binding UiState. ComposeA binding dark, ComposeB binding showLoading. when dark chagne, ComposeB also will ReCompositon with ComposeA . split UiState to alone State Val and using UiState which is best practice ?Albert Chang
08/22/2024, 5:00 AM王欢
08/22/2024, 5:25 AM王欢
08/22/2024, 5:27 AM