aishwaryabhishek3
05/13/2025, 7:44 AMPermissionsScreen(
Modifier.padding(innerPadding),
uiState,
viewModel::onAction,
)
I see that whenever recomposition happens because of changing uiState, the function reference is also a different instance from previous one which causes more recomposition for Composable which should not be recomposed.Zoltan Demant
05/13/2025, 8:57 AMaishwaryabhishek3
05/13/2025, 10:13 AMOlivier Patry
05/13/2025, 4:56 PMsetContent
) and then pass these variables down to my screens to solve this.
class Activity... {
private val viewModel by viewModels()
fun onCreate(...) {
val foo = viewModel::foo
setContent {
MyTheme {
Surface {
MyScreen(viewModel, foo)
}
}
}
}
}