I'm getting recompositions when using a method ref...
# compose
c
I'm getting recompositions when using a method reference in a simple composable for a text input. However, the same composable is skipped if I change the method reference to a lambda
onUpdateName = { myViewModel.updateName(it) }
. Trying to understand why this is the case - thanks!
Copy code
@Composable
fun MyInputForm(
    modifier: Modifier = Modifier,
    myViewModel: MyViewModel = koinViewModel()
) {
    val uiState by myViewModel.uiState.collectAsStateWithLifecycle()

    NameInput(
        name = uiState.name,
        onUpdateName = myViewModel::updateName
    )
}