You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
BaseViewModel:
private val _viewState: MutableState = mutableStateOf(initialState)
val viewState: State = _viewState
@composable
private fun FoodApp() {
val viewModel: FoodCategoriesViewModel = viewModel()
val state = viewModel.viewState.value
Any changes to value will schedule recomposition of any composable functions that read value. In the case of ExpandingCard, whenever expanded changes, it causes ExpandingCard to be recomposed.
here dont hava remember,why it can to be recomposed?
i think it is :
val state by remember{
viewModel.viewState.value
}
but no remember,it can be recomposed.
The text was updated successfully, but these errors were encountered:
BaseViewModel:
private val _viewState: MutableState = mutableStateOf(initialState)
val viewState: State = _viewState
@composable
private fun FoodApp() {
val viewModel: FoodCategoriesViewModel = viewModel()
val state = viewModel.viewState.value
Any changes to value will schedule recomposition of any composable functions that read value. In the case of ExpandingCard, whenever expanded changes, it causes ExpandingCard to be recomposed.
here dont hava remember,why it can to be recomposed?
i think it is :
val state by remember{
viewModel.viewState.value
}
but no remember,it can be recomposed.
The text was updated successfully, but these errors were encountered: